Hei. In our Java-project we are trying to use AspectJ to clean some Exceptions from the serverlogs. What we need is to weave advices into a jar-file such that it also triggers (also on reflective calls).
We are using maven and the aspectj-maven-plugin 1.7.3. When building our project the advices are being woven to all the methods, but on some of them they do not trigger.
Here is an example advice:
@Around("execution(* com.company.XX..*(..))")
public Object noSuchVariableExceptionWrapper(ProceedingJoinPoint proceedingJoinPoint)
throws Throwable{
try{
return proceedingJoinPoint.proceed();
}
catch(Exception e){
// Code with a short log entry
// instead of throwing exception
return null;
}
}
We have quite a bit of code in xml-files that are parsed and run through reflection.
Any tips on how to get around this problem?