错误:java.lang.NoSuchMethodError:org / springframework / asm / ClassVisitor。(I)V

我在我的POM中有这两个依赖项,我认为创建此问题但我尝试了许多不同的方法和更新版本,但没有任何方法对我有用。 有人可以请帮助。 的pom.xml

 org.springframework spring-aop 4.2.0.RELEASE   cglib cglib 2.2  

在此处输入图像描述

解决您的问题

  1. 在管理依赖项时似乎存在JAR冲突。
  2. 在Spring 4.2.0中,ClassVisitor类已包含在Spring-core-4.2.0.RELEASE.jar中,请找到下图。 因此,不需要包含我在依赖项中找到的spring-asm-3.1.3.RELEASE.jar。 ClassVisitor
  3. 当您使用Spring 3.2.X及更高版本时,始终建议使用物料清单 。
  4. 请从依赖项中删除CGLIB代理 ,因为在使用Spring 3.2.X及更高版本时不再需要它。 请参阅spring-framework文档。
  5. 最后你的POM应该如下所示。 谦虚地请求你忽略hibernate和slf4j依赖项。

       4.0.0 org.springframework.samples simpleSpring 0.0.1-SNAPSHOT   1.8 UTF-8 UTF-8  4.2.0.RELEASE  4.2.1.Final  1.0.13 1.7.5  4.11    org.springframework spring-aop 4.2.0.RELEASE   org.springframework spring-aspects 4.2.0.RELEASE   org.springframework spring-beans 4.2.0.RELEASE   org.springframework spring-context 4.2.0.RELEASE   org.springframework spring-context-support 4.2.0.RELEASE   org.springframework spring-core 4.2.0.RELEASE   org.springframework spring-expression 4.2.0.RELEASE   org.springframework spring-instrument 4.2.0.RELEASE   org.springframework spring-instrument-tomcat 4.2.0.RELEASE   org.springframework spring-jdbc 4.2.0.RELEASE   org.springframework spring-jms 4.2.0.RELEASE   org.springframework spring-messaging 4.2.0.RELEASE   org.springframework spring-orm 4.2.0.RELEASE   org.springframework spring-oxm 4.2.0.RELEASE   org.springframework spring-test 4.2.0.RELEASE   org.springframework spring-tx 4.2.0.RELEASE   org.springframework spring-web 4.2.0.RELEASE   org.springframework spring-webmvc 4.2.0.RELEASE   org.springframework spring-webmvc-portlet 4.2.0.RELEASE   org.springframework spring-websocket 4.2.0.RELEASE    org.springframework spring-context ${spring-framework.version}   org.springframework spring-tx ${spring-framework.version}    org.slf4j slf4j-api ${slf4j.version} compile   ch.qos.logback logback-classic ${logback.version} runtime    org.hibernate hibernate-entitymanager ${hibernate.version}    org.springframework spring-test ${spring-framework.version} test   junit junit ${junit.version} test