报错全称
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)注解名称不改全称,可能是清缓存解决,还没实践过,有机会待续。
本文详细解析了在Java开发中遇到的Causedby:java.lang.IllegalArgumentException:errorTypereferredtoisnotanannotationtype错误,阐述了可能的原因,包括修改注解包名等,并提供了具体的解决方案,如将注解改为全称及清缓存的方法。
366

被折叠的 条评论
为什么被折叠?



