I have a message driven bean which, inherently, throws an exception back to the container to rollback jms messsages.
I want to be able to catch this exception, log something, and
then let the exception carry on.
I have a pointcut defined as follows:
pointcut handleException(Message m):Â
call (* myBean.onMessage(Message)) && args(m);
With the advice being:
void around(Message m) throws Exception: handleException(m)
System.out.println("Error here,guv "+e);
My question is two-fold:
1) Can we throw the exception like this and will the throw go back to the container managed transaction??
2) ÂIs this the right way to do this kind of thing? (im assuming not, as the advice is marked as 'Not matched', but maybe this is one for the ajdt guys.)
Sorry - im completely new to this stuff....