<!-- 数据源的配置 sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<!-- 实现数据托管 -->
<prop key="hibernate.hbm2ddl.auto">${dataSource.hbm2ddl.auto}</prop>
<!-- mysql的方言 -->
<prop key="hibernate.dialect">${dataSource.dialect}</prop>
<!-- console 输出 -->
<!-- <prop key="hibernate.format_sql">${dataSource.hibernate.format_sql}</prop> -->
</props>
</property>
解决方法:
改成:
<wbr style="color:rgb(72,72,72); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(224,227,218)"><span style="color:rgb(72,72,72); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(224,227,218)"></span><wbr style="color:rgb(72,72,72); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(224,227,218)"><span style="color:rgb(72,72,72); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(224,227,218)">class="org.springframework.orm.hibernate4.LocalSessionFactoryBean</span><span style="color:rgb(72,72,72); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(224,227,218)">"></span><br></wbr></wbr>
本文详细解释了在使用Spring3.1.2和Hibernate4.2进行整合时遇到的java.lang.NoClassDefFoundError错误的原因,并提供了解决方案。通过将AnnotationSessionFactoryBean更改为LocalSessionFactoryBean,可以有效解决此问题。
1863

被折叠的 条评论
为什么被折叠?



