Spring里这个错误怎么解决啊?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring里这个错误怎么解决啊?相关的知识,希望对你有一定的参考价值。
在配置文件里在配置文件里加入加入就会就会出现出现异常异常,哪里哪里错了错了啊?
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at test.testProject.TestDatasource.main(TestDatasource.java:11)
Caused by: java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
at org.springframework.orm.hibernate4.HibernateTransactionManager.setDataSource(HibernateTransactionManager.java:183)
at org.springframework.orm.hibernate4.HibernateTransactionManager.afterPropertiesSet(HibernateTransactionManager.java:342)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at
加入tx标签时就会出现
<bean id="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
这个是applicationContext配置文件在启动spring的容器时没有加载成功,应该是添加的地方配置错误,你先看着改一下,不行的话把添加出的代码贴上来看看也可以。 参考技术A NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
少spring-jdbc包吧本回答被提问者采纳
以上是关于Spring里这个错误怎么解决啊?的主要内容,如果未能解决你的问题,请参考以下文章
SP1安装过程中,出现错误代码为0x8007000D,怎么解决啊 ?
怎么解决这个问题?是啥问题 sql语句在PL/SQL里运行没问题啊
3dmax运行时错误:dotNET runtime exception:URL上的无效目录这个是怎么回事啊?怎么解决啊?
下标越界:‘[number:-1]’这个问题怎么解决啊,说具体点,好吗?