grails问题Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'解决方案
2016-10-19 16:43
639 查看
今天使用grails连接sqlserver数据库,数据源也配置了,jar包也放到lib文件夹里了,一输入:grails run-app,结果傻眼了!
| Error 2016-10-19 16:02:53,562 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: 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.spring
framework.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 'hibernatePr
operties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.spr
ingframework.beans.factory.BeanCreationException: Error creating bean with name'dialectDetector': Invocation of init method failed; nested exception is org.spr
ingframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.B
eanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'session
Factory'; 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: Er
ror creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hiberna
te.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init me
thod failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apac
he.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 918 | run in ''
^ 662 | run . . in java.lang.Thread
纳尼!和例子一模一样的配置,看到这一句Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver',我以为是jtds包的问题,换了两个jar包,结果不行!重写了一遍代码也是不行,后来,没办法,找度娘!姥姥,也是不靠谱;后来,参照了http://zhidao.baidu.com/link?url=2eIWhOfuzoP9W8rhcls1SxzlpeowLYggVXzNulISUsBG-T_Xt2GiyF5EZuylTL7LzNW53H0NBNRfs7-laMaF2Pd63LWvC7MWvkqTfFcBmQO;
最终执行
E:\grailswork\hellograils>grails clean
| Application cleaned.
E:\grailswork\hellograils>grails compile
E:\grailswork\hellograils>grails run-app
原来grails和java一样啊,有时候也不编译,
| Error 2016-10-19 16:02:53,562 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: 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.spring
framework.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 'hibernatePr
operties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.spr
ingframework.beans.factory.BeanCreationException: Error creating bean with name'dialectDetector': Invocation of init method failed; nested exception is org.spr
ingframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.B
eanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'session
Factory'; 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: Er
ror creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hiberna
te.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init me
thod failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apac
he.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 918 | run in ''
^ 662 | run . . in java.lang.Thread
纳尼!和例子一模一样的配置,看到这一句Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver',我以为是jtds包的问题,换了两个jar包,结果不行!重写了一遍代码也是不行,后来,没办法,找度娘!姥姥,也是不靠谱;后来,参照了http://zhidao.baidu.com/link?url=2eIWhOfuzoP9W8rhcls1SxzlpeowLYggVXzNulISUsBG-T_Xt2GiyF5EZuylTL7LzNW53H0NBNRfs7-laMaF2Pd63LWvC7MWvkqTfFcBmQO;
最终执行
E:\grailswork\hellograils>grails clean
| Application cleaned.
E:\grailswork\hellograils>grails compile
E:\grailswork\hellograils>grails run-app
原来grails和java一样啊,有时候也不编译,
相关文章推荐
- Eclipse cannot load JDBC Driver class: net.sourceforge.jtds.jdbc.Driver
- spring Cannot load JDBC driver class '${DRIVER}' 问题
- The web application [ ] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver
- 解决Mybatis连接Sql server 出现 Cannot load JDBC driver class 'com.mysql.jdbc.Driver '的问题
- 问题:org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Dri
- Cannot load JDBC driver class 'com.mysql.jdbc.Driver' 错误的解决方案
- 遇到的问题:Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
- PowerDesigner导入MySql步骤和解决问题Non SQL Error : Could not load class com.mysql.jdbc.Driver
- Cannot load JDBC driver class 'com.mysql.jdbc.Driver
- Cannot create JDBC driver of class '' for connect URL 'null' 解决方案
- invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.j
- Cannot create JDBC driver of class '' for connect URL 'null'问题解决
- Cannot load JDBC driver class 'oracle.jdbc.drive
- myeclipe eclipse 常遇问题:Some projects cannot be imported 、java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver、The file connot be validate
- org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class
- Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
- 解决Cannot create JDBC driver of class '' for connect URL 'null'问题
- 数据库异常java.sql.SQLException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 与No suitable driver found for jdbc:mysql://localhost:3306/XXXx的问题解决方案
- 解决配置数据库时Could not load JDBC driver class问题