hibernate upgrade

时间:2015-07-06 09:12:24

标签: java hibernate

我从休眠3迁移到休眠4.我面临下面给出的问题。

SEVERE: Exception sending context initialized event to listener instance of class com.restor.application.dp.dao.core.db.HibernateListener
java.lang.ExceptionInInitializerError
at com.razorsight.application.dp.dao.core.db.HibernateUtil.<clinit>(HibernateUtil.java:49)
at com.razorsight.application.dp.dao.core.db.HibernateListener.contextInitialized(HibernateListener.java:20)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager
at com.razorsight.application.dp.dao.core.db.HibernateUtil.<clinit>(HibernateUtil.java:40)
... 14 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ReflectionManager
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
... 15 more

我无法以任何方式解决它。我将jar复制到项目中并在Build path中引用它们。另外,更改了ANT Build XMLs中的引用

所引用的类存在于构建路径中,并且存在于war-&gt; WEB-INF-&gt;中。库。我仍然在服务器启动时遇到这个问题。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

确保类路径中没有“org.hibernate.annotations.common.reflection.ReflectionManager”的副本。

如果您使用的是Maven,那么这将对您有所帮助{。{3}}。