I've created a custom aspect annotation and passed it to the around advice but not able to read the values of the annotation. I'm not sure how to pass annotation to the advice and read its values. This implementation throws below error, Caused by: java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
Here is the sample code
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface LogUserDetail {
String action();
String tableName();
}
@Aspect
@Component
public class LoggingAspect {
@Around("@annotation(com.lowes.lcm.util.LogUserDetail)")
public void logExecutionTime(ProceedingJoinPoint joinPoint, LogUserDetail logUserDetail) throws Throwable {
System.out.println("User Detail" +logUserDetail.action());
}
@LogUserDetail(action = "Add",tableName = "Sample")
public void testAspect(){
}