解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundEr
来源:互联网 发布:中介管理系统源码 编辑:程序博客网 时间:2024/05/16 03:02
我使用的是5.2.8的hibernate的jar包,运行的时候却报错Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext
原因是配置文件中
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property></bean>
用的是hibernate4
解决方法:1:将换成hibernate-core-5.2.8.Final.jar换成hibernate-core-4.2.4.Final.jar
自己运行能够成功解决问题
2:class="org.springframework.orm.hibernate5.HibernateTransactionManager"
没有解决bug,但理论上应该是可以的
注意:在出现此种错误时,会在错误界面的最下方显示如下内容:
To disable this mode, set:
struts.devMode=false
in your WEB-INF/classes/struts.properties file.
很多配置问题都会出现这一错误,因此可能会误导,要非常注意,一般情况下不要那么设置。
0 0
- 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundEr
- 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundErr
- could not open hibernate session for transaction; nested exception is org.hibernate.exception.generi
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.Generi
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExce
- spring-boot配置Hibernate报异常Could not open Hibernate Session for transaction; nested exception is java.
- HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is org.hibernat
- HTTP Status 500 - Could not open JDBC Connection for transaction; nested exception is java.lang.NoCl
- Could not open Hibernate Session for transaction; nested exception is.....远程服务器部署后出现这个问题分析
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: socket creation error
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio
- 解决Could not open Hibernate Session for transaction问题
- 解决Could not open Hibernate Session for transaction问题
- 解决Could not open Hibernate Session for transaction
- Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNest
- SConstruct
- man
- strcpy、memcpy函数的实现
- python——多重表达式
- android软件版本更新
- 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundEr
- VS中配置opencv,使用imshow方法出现窗口名称乱码解决方案
- C++之静态数据成员与静态成员函数
- OkHttp 执行流程与为什么Callback在子线程中执行
- MySQL查询近一个月的数据
- 吴恩达机器学习笔记——softmax回归概率模型推导
- JavaScript模板引擎原理
- [构造 二分图] SRM 693 div1 BipartiteConstruction
- LeetCode之Number Complement