gpt4 book ai didi

mysql - linux env 上的 grails 部署中的 BeanCreationException

转载 作者:太空宇宙 更新时间:2023-11-04 11:15:33 25 4
gpt4 key购买 nike

我正在尝试在 tomcat6 上部署使用 grails 创建的 war 文件。相同的 war 文件在我的 Windows 机器上工作正常它确实给了我以下 prod linux 环境的异常

SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)

我已经过了 How do I fix the org.springframework.beans.factory.BeanCreationException error in my Grails application?

Grails transactionManager exception on Run

但它死了也无济于事

最佳答案

滚动到显示 Cannot load JDBC driver class 'com.mysql.jdbc.Driver' 的末尾。 Grails 异常的通常情况是顶层文本是通用的且无用的,真正的原因在更靠近底部的地方。

我猜您将 MySQL 驱动程序 jar 放在了 lib 目录中,但 Grails 没有在那里找到它。你不应该使用 jars,除非它们在在线 repo 中不可用,而 MySQL 驱动程序肯定是。事实上,它是 dependencies block 中 BuildConfig.groovy 中的示例条目。取消注释,可选择更新到最新版本 (5.1.28),然后重新部署您的 war 文件。确保它在文件中,在 WEB-INF/lib

关于mysql - linux env 上的 grails 部署中的 BeanCreationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21287202/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com