错误: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; //标识保存的时间
	
}

切面如下:

image-20200813170458641

图中的标记就是错误的原因

必须方法中参数与注解传入参数必须一致

正确写法:

image-20200813170807948

即可解决

posted on 2020-08-13 17:10  liqiangbk  阅读(2158)  评论(0编辑  收藏  举报

导航