I am trying to capture my annotation in an AOP pointcut like this (as seen on this question):
@After("@annotation(com.mypackage.annotation.Traza)")
protected void logAnnotatedMethods(JoinPoint pjp, Traza traza) throws Throwable {
LOGGER.info("It's here");
LOGGER.info("Traza:" + traza);
}
But I keep getting a java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
exception. If I remove the Traza parameter then it works and the pointcut is working wherever I annotate it with @Traza.
I know I can use reflection to obtain the annotation but shouldn't this be working too?