java.lang.NoClassDefFoundError: org/hibernate/engine/SessionFactoryImplementor
详细错误提示如下:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDao’ defined in file [E:\Workspaces\MyEclipse Professional 2014\Spring_Register_Hibernate_Struts_0000_Final\WebRoot\WEB-INF\classes\com\register\dao\impl\UserDaoImpl.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘txAdvice’: Cannot resolve reference to bean ‘transactionManager’ while setting bean property ‘transactionManager’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’ defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/SessionFactoryImplementor
解决方法:来至于http://www.cnblogs.com/Mr-Clint/p/3580287.html
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager" >
<property name="dataSource" ref="dataSource" /> <!-- 添加这一行 --!>
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>