We use Spring AOP with Log4j to register with our application. I implemented @Before, @After, @AfterTrowing advice in the app. But I ran into the following problem:
When any exception hits the catch block, it does not call the @AfterTrowing tip to print the trace of the error stack.
public void create() throws Exception
{
try
{
throw new NullPointerException();
}
catch(NullPointerException ex)
{
}
}
I want to print an "error stack trace" for an exception caught in a catch block. It means that every exception occurs in the try block and is caught by catch, then some tips should be called to print error details.
Thanks in advance!
source
share