Today, the framework wants to use annotation to implement section function, and the result is error type referred to is not an annotation type:RedisCache
The code is as follows:
Note:
the
@Target({ ElementType.METHOD })
@Retention( RetentionPolicy.RUNTIME )
@Inherited
@Documented
public @interface RedisCache {
public String key() default “”;
public long TTL() default 0L;
}
Section:
@Around(“@annotation(redisCache)”)
public void redisCache(ProceedingJoinPoint joinPoint,RedisCache redisCache){
String targetName = joinPoint.getTarget ().getClass().getName();
String methodName = joinPoint.getSignature ().getName();
Object[] arguments = joinPoint.getArgs ();
Object result = null;
String cacheKey = getCacheKey(targetName, methodName, arguments);
System.out.println (“hahaha” + cachekey);
}
the original annotation must be passed in as a parameter, and the red part must be the same.
Read More:
- Error: (22,57) Java: type parameter… Mapper is not in the range of type variable M
- array type has an incomplete element type
- Solve the problem that the delete request is not available under SpringBoot. There was an unexpected error (type=Method Not Allowed, status=405).
- Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- Error: property ‘TZ’ does not exist on type ‘type of moment’
- When C language refers to a user-defined type as a parameter, an error segmentation fault is reported
- Type definition error – one of the causes of type definition errors is WM in Oracle_ Concat function usage
- Arduino reports an error when writing a custom library file to solve the problem of not name of type, not declared in this scope
- Element ‘dependency‘ cannot have character [children], because the type‘s content type is element-on
- Unity Error:InvalidCastException: Cannot cast from source type to destination type.
- Failed to execute ‘getComputedStyle’ on ‘Window’: parameter 1 is not of type ‘Element’.
- After introducing sass into Vue project, start to report error typeerror [err]_ INVALID_ ARG_ Type]: the “path” argument must be of type string
- error: non-const lvalue reference to type cannot bind to a value of unrelated type
- On the usage of ‘ref.stor.type search’ field in SAP WM movement type
- Uncaught TypeError: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node How to Fix
- Uncaught TypeError: Failed to execute ‘removeChild’ on ‘Node’: parameter 1 is not of type ‘Node’.
- Object of type timestamp is not JSON serializable
- Es error mapper of different type, current_ Type “text” solution
- Error tips:array type has incomplete element type
- Type error: object (…) is not a function