摘要:错误java。lang.IlliegalArgumentException:errorTypereferredtoinotanotationtype:CacheFind解析:使用注释方法切片时,会报告上述错误。注释如下:@Target(ElementType.METHOD)@Retention(Retention Policy.RUNTIME)public@interfaceCache
报错 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; //标识保存的时间
}
切面如下:
图中的标记就是错误的原因
必须方法中参数与注解传入参数必须一致
正确写法:
即可解决