升级到Spring 4和hibernate 4.3.5后获取org/springframework/dao/QueryTimeoutException
我最近通过SPRING+Hibernate项目升级到了Spring4.1.6,Hibernate升级到了Hibernate4.3.5。但是这样做我得到了这个例外升级到Spring 4和hibernate 4.3.5后获取org/springframework/dao/QueryTimeoutException,hibernate,spring-mvc,Hibernate,Spring Mvc,我最近通过SPRING+Hibernate项目升级到了Spring4.1.6,Hibernate升级到了Hibernate4.3.5。但是这样做我得到了这个例外 Error creating bean with name 'transactionManager' defined in class path resource [fileName]: Invocation of init method failed; nested exception is java.lang.NoClassDefF
Error creating bean with name 'transactionManager' defined in class path resource [fileName]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/dao/QueryTimeoutException
这是具有休眠依赖项的POM文件,我使用PostgreSQL作为数据库
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.0.2.Final</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
org.hibernate
冬眠核心
4.3.5.最终版本
org.hibernate
休眠验证器
5.0.2.2最终版本
postgresql
postgresql
9.1-901.jdbc4
这是文件名中的配置
<bean id = "transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager" lazy-init="true">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
解决此问题的任何帮助都将非常可观。从错误中
Error creating bean with name 'transactionManager' defined in class path resource [fileName]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/dao/QueryTimeoutException
很明显,容器无法加载类文件QueryTimeoutException
文件随附
添加此依赖项
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
org.springframework
德克萨斯州春季
4.1.6.1发布
从错误中
Error creating bean with name 'transactionManager' defined in class path resource [fileName]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/dao/QueryTimeoutException
很明显,容器无法加载类文件QueryTimeoutException
文件随附
添加此依赖项
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
org.springframework
德克萨斯州春季
4.1.6.1发布
从错误中
Error creating bean with name 'transactionManager' defined in class path resource [fileName]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/dao/QueryTimeoutException
很明显,容器无法加载类文件QueryTimeoutException
文件随附
添加此依赖项
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
org.springframework
德克萨斯州春季
4.1.6.1发布
从错误中
Error creating bean with name 'transactionManager' defined in class path resource [fileName]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/dao/QueryTimeoutException
很明显,容器无法加载类文件QueryTimeoutException
文件随附
添加此依赖项
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
org.springframework
德克萨斯州春季
4.1.6.1发布