java中运行时出现下面的错误是什么原因呢?其中有配置spring

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'txManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.DataSourceTransationManager] for bean with name 'txManager' defined in class path resource [beans.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DataSourceTransationManager......

第1个回答  2018-02-13
目测是你的 环境问题,导致容器没法加载数据源相关依赖,org.springframework.jdbc.datasource.DataSourceTransationManager
你搜搜看项目里面有没有这个类,没有就是少包了,有不止一个很可能是冲突了
第2个回答  2014-01-10
缺少org.springframework.jdbc的jar包,在spring的jar包下有的,引入进来即可。追问

哦,谢谢,那请问这个jar包的名称是什么呀?

追答

这。。。打开spring的jar包就能看到全名就是上面那个啊,org.springframework.jdbc-3.0.5.RELEASE.jar。我的是3.0.5。你可能用的不一样。

本回答被提问者采纳
第3个回答  2014-01-10
java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DataSourceTransationManage
jar包没导入吧?追问

哦,谢谢,那请问这里可以看的出什么jar包没有导入吗?

第4个回答  2014-01-10
Advisor 那段配置错误了
贴那段 xml出来细看

格式化一下文字啊。。。追问

谢谢!!!

追答

你这个没有引入 spring的jdbc包(spring-jdbc.jar),org.springframework.jdbc.datasource.DataSourceTransactionManager 在此包中哦

我看你用的是spring2.5
那么位置在spring-framework-2.5.6\dist\modules\spring-jdbc.jar

第5个回答  2014-01-10
只列出异常怎么帮得上你。好歹也上代码啊

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网