Я объявил аннотацию действия < /p> [code]@Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Action { String name(); } < /code> Когда я попытался сделать точку < /p> @Aspect @Component public class LogAspect { @Pointcut("@annotation(com.wisely.highlight_spinrg4.ch1.aop.Action)") //it failed here public void annotationPointCut() {}
@Before("execution(*com.wisely.highlight_spring4.ch1.aop.DemoMethodService.*(..))") public void before(JoinPoint joinPoint) { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); System.out.println("Method Interpreter" + method.getName()); } } < /code> Это бросил ошибку: < /p> java.lang.IllegalArgumentException: error Type referred to is not an annotation type: com$wisely$highlight_spinrg4$ch1$aop$Action [/code] Я понятия не имею, так как я использовал @Interface , чтобы установить действие в качестве аннотации. Кто -нибудь может предложить некоторую помощь?