我正在尝试将Spring 3.0.5与Hibernate 3.5.3-Final一起使用,当Spring创建会话时,它会引发异常:
java.lang.NoClassDefFoundError:org / hibernate / annotations / common / AssertionFailure
问题是AssertionFailure
类实际上在org.hibernate
包中(不是org.hibernate.annotations.common
)。 3.0.5是Spring的最新稳定版本,而Hibernate 3.5.3-Final大约在一年前发布,因此它似乎很奇怪,它不会被支持。这个问题有一些解决方法吗?
答案 0 :(得分:1)
3.3版本的hibernate-commons-annotations是一个错误的版本。使用3.2.0.Final。请参阅http://forum.springsource.org/showthread.php?89693-AnnotationSessionFactoryBean-needs-MetadataProvider。
答案 1 :(得分:0)
你还需要hibernate commons annotations jar(https://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate-commons-annotations/3.3.0.ga/)