org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor 的 java.lang.NoClassDefFoundError
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23595958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.NoClassDefFoundError for org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor
提问by Dean
Folks I am getting the following compilation error:
伙计们,我收到以下编译错误:
May 11, 2014 1:30:41 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:META- INF/spring/context.xml]
Offending resource: ServletContext resource [/WEB-INF/spring/appServlet/servlet- context.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [jar:file:/C:/Users/Dean/Downloads/springsource/vfabric-tc-server- developer-2.9.5.SR1/base-instance/wtpwebapps/cointraders-api/WEB-INF/lib/data-core-1.0.0- SNAPSHOT.jar!/META-INF/spring/context.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.springframework.data.jpa.repository.config.JpaRepositoryNameSpaceHandler] for namespace [http://www.springframework.org/schema/data/jpa]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor
I am running spring 3.1.1.RELEASE. I have been trying to figure out this problem and there's little help from previous searches. My stack trace here link
我正在运行 spring 3.1.1.RELEASE。我一直在试图找出这个问题,之前的搜索几乎没有帮助。我的堆栈跟踪链接
采纳答案by geoand
The documentation for AbstractAdvisingBeanPostProcessorsays that it exists since version 3.2, not Spring 3.1. Also from herewhere you can see all the classes in the spring-aop artifact from Spring 3.1.4, that class does not seem to exist.
AbstractAdvisingBeanPostProcessor的文档说它从 3.2 版开始存在,而不是 Spring 3.1。同样从这里您可以看到 Spring 3.1.4 中 spring-aop 工件中的所有类,该类似乎不存在。
I suggest you upgrade to Spring 3.2 and make sure that there are no Spring 3.1 dependencies on your classpath
我建议您升级到 Spring 3.2 并确保类路径上没有 Spring 3.1 依赖项
回答by Elbek
After seeing your stack trace I noticed it saying Caused by: java.lang.ClassNotFoundException: org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
看到你的堆栈跟踪后,我注意到它说 Caused by: java.lang.ClassNotFoundException: org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
This is the cause for No class def found exception. Add spring-aopjar to your run time class path. That jar must be missing now.
这是 No class def found 异常的原因。将spring-aopjar添加到您的运行时类路径。那个罐子现在肯定不见了。
回答by geoand
I ran into this issue as well. You need to exclude the spring-aop and spring-asm that come with spring-data and specify the spring-aop version you want. I'm using gradle, here is a snippet:
我也遇到了这个问题。需要排除spring-data自带的spring-aop和spring-asm,指定你想要的spring-aop版本。我正在使用 gradle,这是一个片段:
compile group: 'org.springframework', name: 'spring-aop', version:'3.2.8.RELEASE'
compile (group: 'org.springframework.data', name: 'spring-data-jpa', version:'1.3.4.RELEASE'){
exclude(module: 'spring-aop')
exclude(module: 'spring-tx')
exclude(module: 'spring-asm')
}
回答by Frank_Shi
If you use maven,you can use command 'mvn dependency tree' to check you project all jar dependencies,find depend on spring3.1.x and exclusion that.
如果你使用maven,你可以使用命令'mvn dependency tree'来检查你的所有jar依赖项,找到依赖spring3.1.x并排除它。
回答by Adrian Redgers
Following on from the extremely useful answer by Jay Paulyniceabove, my build.gradle
file contains this (Spring versions are managed by our own BOM elsewhere) :-
继上面Jay Paulynice非常有用的答案之后,我的build.gradle
文件包含这个(Spring 版本在其他地方由我们自己的 BOM 管理):-
dependencies {
// Handle spring-aop conflict affecting AopInfrastructureBean (used by spring-security-core PermissionEvaluator).
// Only use spring-aop from spring-security-core, and exclude any other instances of it.
def withoutSpringAop = {
exclude group: 'org.springframework', module: 'spring-aop'
}
implementation group: 'org.springframework.security', name: 'spring-security-core'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '5.1.4', withoutSpringAop
implementation group: 'org.springframework.security', name: 'spring-security-web', withoutSpringAop
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', withoutSpringAop
...
}
This simple answer belies a lot of pain; I found it useful/necessary to search for 'aop' in the (fully expanded) dependency tree in my Intellij gradle window.
这个简单的答案掩盖了很多痛苦;我发现在我的 Intellij gradle 窗口的(完全扩展的)依赖关系树中搜索“aop”很有用/必要。