ERROR context.GrailsContextLoader - Error executing bootstraps: 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'
Message: 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'
疯了,在grails老是报找不到MYSQLjar包的错,我也放lib中,也导入项目中了,也clean了。。。大神帮忙啊!
答案:2 悬赏:50 手机版
解决时间 2021-03-01 19:07
- 提问者网友:椧運幽默
- 2021-03-01 11:16
最佳答案
- 五星知识达人网友:爱难随人意
- 2021-03-01 12:35
grails 不能加载添加的lib jar
在工程目录中运行如下命令。
grails compile --refresh-dependencies
如果失败:则先运行 grails clean 在运行 上一条命令,基本可以成功。
你还可以使用grails的mysql connection 插件 ,方法是:
在BuildConfig.groovy中添加
compile ":mysql-connectorj:5.1.22.1"
在工程目录中运行如下命令。
grails compile --refresh-dependencies
如果失败:则先运行 grails clean 在运行 上一条命令,基本可以成功。
你还可以使用grails的mysql connection 插件 ,方法是:
在BuildConfig.groovy中添加
compile ":mysql-connectorj:5.1.22.1"
全部回答
- 1楼网友:不想翻身的咸鱼
- 2021-03-01 12:41
不明白啊 = =!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯