Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/SystemException
表面上看是没有导包,实际上可能是sessionFactory的配置或者事务的问题
Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]
没有创建SessionFactory这个bean在ServletContext资源下,位置在applicationContext.xml,貌似是整合SSH2框架问题,在Spring配置文件applicationContext.xml里没定义SessionFactory这个bean。
总的来说,配置出错,找不到对应的类!
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<!-- 数据库连接 -->
<property name="dataSource">
<ref local="dataSource" />
</property>
<!-- hibernate自身属性 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key = "hibernate.format_sql">true</prop>
<prop key = "hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<!-- 解决no session found -->
<prop key = "hibernate.current_session_context_class">thread</prop>
</props>
</property>
<!-- 映射文件 -->
<property name = "annotatedClasses">
<list>
<value>com.xinvalue.bean.User</value>
</list>
</property>
</bean>