AspectJ報錯:error at ::0 can't find referenced pointcut XXX


概述Spring boot項目中,使用Aspectj實現AOP面向切面編程,以處理一些請求日志或者對某些方法進行一些監控的時候,報了【can't find referenced pointcut】的錯誤。

報錯信息如下:

Initialization of bean failed; nested exception is java.lang.IllegalArgu
        mentException: error at ::0 can't find referenced pointcut executeController

環境 jdk 8;spring版本 4.0.0;maven 3.5.4。 

報錯原因 spring AOP依賴jar版本過低。

解決方案 將aspectjweaver.jar替換較新的aspectjweaver-1.9.0.jar

http://mavenrepository.com/ 搜aspectjweaver,找到:

<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.9.0</version>
</dependency>

當然,更高版本的也可以。關於低版本jdk,網上搜到了一些對應aspectjweaver配置信息:

JDK1.6 ——aspectjweaver 1.6

JDK1.7 ——aspectjweaver 1.7.3+

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM