I am trying to use Spring 3.0.5 with Hibernate 3.5.3-Final and when Spring creates the session,开发者_StackOverflow中文版 it throws an exception:
java.lang.NoClassDefFoundError: org/hibernate/annotations/common/AssertionFailure
The issue is that the AssertionFailure
class is actually in the org.hibernate
package (not org.hibernate.annotations.common
). 3.0.5 is the latest stable release of Spring and Hibernate 3.5.3-Final was released about a year ago, so it seems odd that it would not be supported. Is there some workaround for this issue?
The 3.3.0 version of hibernate-commons-annotations was an erroneous edition. Use 3.2.0.Final. See http://forum.springsource.org/showthread.php?89693-AnnotationSessionFactoryBean-needs-MetadataProvider.
You also need the hibernate commons annotations jar (https://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate-commons-annotations/3.3.0.ga/)
精彩评论