解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundEr
2017-04-07 20:18
1256 查看
我使用的是5.2.8的hibernate的jar包,运行的时候却报错Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext
原因是配置文件中
用的是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.
很多配置问题都会出现这一错误,因此可能会误导,要非常注意,一般情况下不要那么设置。
原因是配置文件中
<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,但理论上应该是可以的
注意:在出现此种错误时,会在错误界面的最下方显示如下内容:
You are seeing this page because development mode is enabled.
To disable this mode, set: struts.devMode=false
in your WEB-INF/classes/struts.properties file.
很多配置问题都会出现这一错误,因此可能会误导,要非常注意,一般情况下不要那么设置。
相关文章推荐
- 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.exception.Generi
- Could not open JPA EntityManager for transaction; nested exception is java.lang.NullPointerException
- could not open hibernate session for transaction; nested exception is org.hibernate.exception.generi
- HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is org.hibernat
- 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
- Could not open Hibernate Session for transaction; nested exception is.....远程服务器部署后出现这个问题分析
- 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 org.hibernate.TransactionExcep
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: socket creation error
- Could not open Hibernate Session for transaction . or java.net.SocketException: Broken pipe
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio
- 【错误】:Could not open JDBC Connection for transaction; nested exception is: Communications link fai...
- 解决Could not open Hibernate Session for transaction问题
- 解决 org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for cu
- 【错误】:Could not open JDBC Connection for transaction; nested exception is: Communications link failure;The last packet sent successfully to the server was 1 milliseconds ago
- Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNest
- Could not open JPA EntityManager for transaction; nested exception is javax.pers