解决Exception:Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassD

Posted KeepUp~

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决Exception:Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassD相关的知识,希望对你有一定的参考价值。

原因是配置文件中

<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,但理论上应该是可以的

以上是关于解决Exception:Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassD的主要内容,如果未能解决你的问题,请参考以下文章

解决org.hibernate.exception.SQLGrammarException:could not insert

解决ERROR: Could not find a version that satisfies the requirement 问题及 ERROR: Exception:Traceback

Java EE 之 Hibernate异常解决:org.hibernate.exception.SQLGrammarException: could not execute statement(示例代

MyEclipse Servers视窗出现“Could not create the view: An unexpected exception was thrown”错误解决办法

Could not execute menu item(internal error),[Exception] Could not perform service action:服务尚未启动。

NetCore HttpClient The SSL connection could not be established, see inner exception