(1)hibernate4整合spring3.1的过程中,发现了java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider异常
查了一下相关资料,原来发现hibernate4已经将hibernate3的一些功能改掉了,在hibernate4已经不使用CacheProvider了,所以做了以下修改,
原先:<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> 改成:<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
(2) java.lang.NoClassDefFoundError: org/hibernate/engine/SessionFactoryImplementor
原先hibernate3: <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> hibernate4: <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean>