我正在尝试升级到Hibernate 4.3.8
和Spring 4.1.6
版本。当我尝试初始化上下文时获取异常如下。
Caused by: java.lang.NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition;
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.7.0_80]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2625) ~[na:1.7.0_80]
at java.lang.Class.getDeclaredMethods(Class.java:1868) ~[na:1.7.0_80]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:571) ~[spring-core-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:488) ~[spring-core-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:501) ~[spring-core-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:474) ~[spring-core-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1065) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1038) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:860) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:790) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:542) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:436) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:412) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:186) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1105) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
... 29 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) ~[catalina.jar:7.0.59]
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) ~[catalina.jar:7.0.59]
... 49 common frames omitted
罐子清单
弹簧AOP-4.1.6.RELEASE.jar 弹簧数据JPA-1.2.0.RELEASE.jar, spring-security-web-4.0.1.RELEASE.jar,spring-aspects-4.1.6.RELEASE.jar,spring-expression-4.1.6.RELEASE.jar,spring-test-4.1.6.RELEASE.jar,弹簧批次核心2.1.7.RELEASE.jar,弹簧JDBC-4.1.6.RELEASE.jar,弹簧TX-4.1.6.RELEASE.jar,弹簧批基础设施2.1.7.RELEASE。罐子,弹簧ORM-4.1.6.RELEASE.jar,弹簧网络4.1.6.RELEASE.jar,弹簧豆-4.1.6.RELEASE.jar,弹簧OXM-4.1.6.RELEASE.jar,弹簧webmvc-4.1.6.RELEASE.jar,弹簧上下文4.1.6.RELEASE.jar,弹簧安全ACL-4.0.1.RELEASE.jar,弹簧webmvc的portlet-4.1.6.RELEASE。罐子,弹簧上下文支持-4.1.6.RELEASE.jar,弹簧安全配置,4.0.1.RELEASE.jar,弹簧WS-核心2.1.3.RELEASE.jar,弹簧芯4.1。 6.RELEASE.jar,弹簧安全核心4.0.1.RELEASE.jar,弹簧XML的2.1.3.RELEASE.jar,弹簧 - 数据 - 公地芯1.4.0.RELEASE.jar,弹簧安全标签库,4.0.1.RELEASE.jar hibernate-c3p0-4.3.8.Final.jar hibernate-envers-4.3.8.Final.jar 休眠的搜索引擎,4.5.3.Final.jar 休眠公地的注解,4.0.5.Final.jar
冬眠,JPA-2.1-API 1.0.0.Final.jar
hibernate-search-orm-4.5.3.Final.jar hibernate-core-4.3.8.Final.jar 休眠-jpamodelgen-4.3.8.Final.jar
休眠 - 验证 - 5.1.3.Final.jar hibernate-ehcache-4.3.8.Final.jar hibernate-search-4.5.3.Final.jar 休眠-的EntityManager,4.3.8.Final.jar
冬眠-搜索分析仪-4.5.3.Final.jar
答案 0 :(得分:0)
解决您的问题
如果您使用Maven,请在POM.xml文件中添加此依赖项。
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.8.Final</version>
</dependency>