错误: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

即可解决


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM