为了账号安全,请及时绑定邮箱和手机立即绑定

java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy

严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@105fece7] to prepare test instance [org.seckill.dao.SeckillDaoTest@52045dbe]

java.lang.IllegalStateException: Failed to load ApplicationContext


Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy


Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy



总是提示缺少类,但是在pom.中已经加了spring-jdbc 版本是4.1.7.RELEASE 

正在回答

1 回答

jdbc.properties文件里,改成(前面加上mysql):

mysql.driver=com.mysql.jdbc.Driver
mysql.url=jdbc:mysql://127.0.0.1:3306/seckill?useUnicode=true&characterEncoding=utf8
mysql.username=root
mysql.password=root

0 回复 有任何疑惑可以回复我~
#1

Nzero 提问者

感谢回答,这个方法试过了,也不行,最后是换了Spring的版本才好的
2017-01-06 回复 有任何疑惑可以回复我~
#2

调皮的魔法少女李狗蛋儿 回复 Nzero 提问者

咋换spring版本啊
2017-07-15 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信