java.lang.ClassNotFoundException: org.aspectj.util.PartialOrder$PartialComparable

前端 未结 4 2060
醉话见心
醉话见心 2021-01-12 03:11

I am using Spring 4.2.4.RELEASE in my web application and I would like to remove the dependency on aspectjweaver.jar from it. I don\'t use AOP directly and I certainly don\'

相关标签:
4条回答
  • 2021-01-12 03:38

    Adding spring-boot-starter-aop dependency would resolve the issue, if you are facing it in the springboot application.

    <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
    
    0 讨论(0)
  • 2021-01-12 03:43

    The answer is no. Spring AOP is syntactically an AspectJ subset, thus it uses AspectJ classes for parsing pointcuts. It also exposes AspectJ classes like JoinPoint, ProceedingJoinPoint and AspectJ annotations like @Poinctut, @Before, @After, @Around, @DeclareParents etc.

    0 讨论(0)
  • 2021-01-12 03:49

    I encountered this problem when using the @Transactional annotation on a class annotated with @Component in Spring Boot similar to: https://spring.io/guides/gs/managing-transactions/

    The easiest way to fix it is to add the proper Maven dependency:

    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.8.9</version>
    </dependency>
    
    0 讨论(0)
  • 2021-01-12 03:52

    Is there any way to completely remove the dependency on aspectjweaver.jar ?

    No, you cannot. You are using Spring AOP. The Spring project spring-aop does have a hard dependency on aspectjweaver.jar. Read the Spring-aop docs that clearly identifies it as a dependency.

    0 讨论(0)
提交回复
热议问题