错误:Type referred to is not an annotation type: CacheFind
报错 java.lang.IllegalArgumentException: error Type referred to is not an annotation type: CacheFind
解析:
在使用注解的方式进行切面的时候,报以上错误,
注解如下:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CacheFind {
public String key(); //标识存入redis中key的前缀
public int seconds() default 0; //标识保存的时间
}
切面如下:
图中的标记就是错误的原因
必须方法中参数与注解传入参数必须一致
正确写法:
即可解决
posted on 2020-08-13 17:10 liqiangbk 阅读(2158) 评论(0) 编辑 收藏 举报