天天看點

error Type referred to is not an annotation type: xxx(注解名)

文章目錄

      • 報錯全稱
      • 疑似産生的原因
      • 彎路、坑
      • 解決方案

報錯全稱

Caused by: java.lang.IllegalArgumentException: error Type referred to is not an annotation type: xxx

疑似産生的原因

修改過注解的包名

彎路、坑

還以為是沒編譯到位,還屁颠屁颠的重新編譯了一遍,當然不行了

解決方案

1)将注解改為全稱

@Pointcut("@annotation(DataScope)")

改為

@Pointcut("@annotation(com.xx.annotation.DataScope)")

重新開機,繼續報錯:

is not an annotation type: com$xx$xx$log$annotation$Log

但是,先别急,仔細一看,這個報錯的類并不是剛才那個類呀。是以,搞定,——這個新錯誤也是同樣的解決辦法。

2)注解名稱不改全稱,可能是清緩存解決,還沒實踐過,有機會待續。

文章目錄

      • 報錯全稱
      • 疑似産生的原因
      • 彎路、坑
      • 解決方案