I am new to AOP and have been trying to create an AOP-based exception handling framework for my application. I know this question has been asked in these forums before, but I have not been able to determine why exceptions thrown in the code are not being logged. Essentially, I am just trying to log all exceptions that are thrown in the com.foo.bar package.
<bean id="errorHandler" class="com.foo.bar.arch.error.ErrorHandler"/>
In order to test this, I am simply throwing a MyException in my test code:
public final class ErrorHandler
public void processError(JoinPoint logged, MyException exception)
Am I incorrect in catching the exception here? My understanding was that it would still be logged.
public void testAOPErrorHandling()
throw new MyException("something");
// do something