Hibernate NoClassDefFoundError

时间:2014-06-10 10:15:58

标签: hibernate maven

我在依赖项中有hibernate-commons-annotations-4.0.1.Final.jar时出现以下错误。可能有什么不对?

Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ClassLoadingException

编辑:

java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ClassLoadingException
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1132)
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1402)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
hibernate.HibernateUtil.<clinit>(HibernateUtil.java:25)

1 个答案:

答案 0 :(得分:1)

<dependency> <groupId>org.hibernate.common</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>4.0.4.Final</version> </dependency>