0
我們有一個在WebLogic 10.3.6應用程序服務器中正常運行的.ear文件。 .ear使用Spring 3.0.5和Hibernate 3.5.2。WebLogic 10.3.6中的怪異ClassNotFoundException
如果我們在另一個WebLogic 10.3.6服務器中部署相同的.ear文件,我們會得到下一個錯誤。
org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterService': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private nl.surf.adapter.generic.dao.MessageFilterDAO nl.surf.adapter.generic.service.FilterService.messageFilterDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/domain-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private nl.surf.adapter.generic.dao.MessageFilterDAO nl.surf.adapter.generic.service.FilterService.messageFilterDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/domain-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/domain-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: java.lang.NoClassDefFoundError
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
我已經嘗試了幾種解決方案:在的.war/WEB-INF/lib目錄
- 將hibernate.jar文件(所有罐子現在在的.ear/lib目錄)
- 使用<喜歡-Web-INF類>真正< /喜歡-WEB-INF類中的.war >/WEB-INF/weblogic.xml中
似乎沒有任何工作。 我有點迷失在這裏...
解決自己的問題下面的標籤。 還不能回答,所以明天回覆。 – tsluijter
我在拋出的異常中看到,在web.xml中缺少hibernate註釋bootstraping。對? – Sam
我遇到了與Velocity相同的問題。我對解決org/apache/velocity/app/VelocityEngine這個NoClassDefFoundError問題的方法很感興趣。 –