It seems the error is where you are trying to combine pointcuts and to refer to the actionAnnotatedPointCut
.
For example, you might have had
@Pointcut ("@annotation(path.to.my.CustomAnnotation)")
public void actionAnnotatedPointCut() {}
@Around("actionAnnotatedPointCut()")
public Object doAround(ProceedingJoinPoint pjp) {
...
}
which would work fine.
If you change your pointcut to
@Pointcut ("@annotation(customAnnotation)")
public void actionAnnotatedPointCut(CustomAnnotation customAnnotation) {}
The expression in the @annotation(..)
is referring to a parameter in the method by name. That parameter's type will be used to advise a method annotated with that type.
Now your pointcut that combines this pointcut must have the same parameter name in its reference to the @Pointcut
method and must have a method parameter of the appropriate type.
@Around("actionAnnotatedPointCut(customAnnotation)")
public Object doAround(ProceedingJoinPoint pjp, CustomAnnotation customAnnotation) {
...
}
That's what the error is saying
incompatible number of arguments to pointcut, expected 1 found 0
It's expecting one argument, customAnnotation
in our case, but it's missing.