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)注解名称不改全称,可能是清缓存解决,还没实践过,有机会待续。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章