Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor的java.lang.NoClassDefFoundError_Java_Spring_Spring Mvc_Spring Data Jpa - Fatal编程技术网

org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor的java.lang.NoClassDefFoundError

org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor的java.lang.NoClassDefFoundError,java,spring,spring-mvc,spring-data-jpa,Java,Spring,Spring Mvc,Spring Data Jpa,伙计们,我遇到以下编译错误: 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 defi

伙计们,我遇到以下编译错误:

 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

我正在运行Spring3.1.1.RELEASE。我一直在试图解决这个问题,但以前的搜索几乎没有帮助。这里我的堆栈跟踪

在看到您的堆栈跟踪后,我注意到它说的是由以下原因引起的
:java.lang.ClassNotFoundException:org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor

这是找不到class def异常的原因。将jar添加到运行时类路径。那个罐子现在一定不见了

的文档说它是从3.2版开始存在的,而不是Spring 3.1版。 另外,从Spring3.1.4中可以看到SpringAOP工件中的所有类,该类似乎并不存在


我建议您升级到Spring3.2,并确保您的类路径上没有Spring3.1依赖项

我也遇到过这个问题。您需要排除spring数据附带的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')
}

如果您使用maven,您可以使用命令“mvn dependency tree”检查您项目中的所有jar依赖项,查找Dependent on spring3.1.x并排除该依赖项。

根据上面非常有用的答案,我的
build.gradle
文件包含以下内容(Spring版本由我们自己的BOM在其他地方管理):-


这个简单的答案掩盖了很多痛苦;我发现在Intellij gradle窗口的(完全扩展的)依赖关系树中搜索“aop”很有用/必要

看起来你的错误是这样的:[检查这个答案][1][1]:你能把整个堆栈跟踪吗?这个异常定义没有帮助,因为我有SpringAOP3.1.1.RELEASE,但是我使用的SpringDataJPA版本是1.1.2.RELEASE;它似乎依赖于Spring3.1.2.0版本。我不确定spring-core-3.1.1应该使用哪个版本的spring-data-jpa。RELEASE
mvn-dependency:tree
,带冒号
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
  ...
}