my question is related to this question
We have different aspect class that do @around advice on different part of an application (fat client in Swing) to measure the execution time.
I have another aspect (ExceptionHandler) that do @around on all the aspects method i wrote.
I did this to avoid that the aspects created would throw exception and make the client application fails. So basically, i try catch the Proceed of my other @around method and just log exception that arise. I only throw an exception when i detect it come from the proceedingJoinPoint
if (joinPoint.getSignature().getDeclaringTypeName().equalsIgnoreCase("org.aspectj.lang.ProceedingJoinPoint")) {
throw exception;
}
Is it valid to do this?
In Eclipse with AJDT the app run fine and i tested the ExceptionHandler and it worked as expected.
But in other env. (Integration) the application fail as soon as it meet a line advised by the exceptionHandler with this Error
Exception in thread "main" java.lang.NoSuchMethodError: com.xxx.yyy.aop.aspect.ExceptionHandlerAspect.aspect
Of()Lcom/xxx/yyy/aop/aspect/ExceptionHandlerAspect;
at com.xxx.yyy.aop.aspect.ecs.AspectBaseEcs.inspectLoginInfo(AspectBaseEcs.java:65)
at com.xxx.yyy.app.es.security.Security.loadApplications(Security.java:172)
at com.xxx.yyy.app.es.gui.VSDlgLogin.loadSecurity(VSDlgLogin.java:346)
at com.xxx.yyy.app.es.ApplicationSuite.start(ApplicationSuite.java:839)
at com.xxx.yyy.app.es.ApplicationSuite.main(ApplicationSuite.java:501)
I have also decompile the code to see if aspectOf() was weaved into my ExceptionHandler and the method is there!!!!!!!???????????
Why this error rise...?
I'm clueless.