-
1. Re: EJB "shutdown exception" is not caught by EJB interceptors
wdfink Jan 23, 2014 12:11 PM (in response to nmoelholm)No, the Interceptor has the same lifecycle as the Bean itself (from the EJB spec) and get invoked if the bean is invoked. So there is no chance to get this working.
Only possibility I know is to have a client side interceptor, but this did not work for local invocations.
-
2. Re: Re: EJB "shutdown exception" is not caught by EJB interceptors
nmoelholm Jan 24, 2014 9:33 AM (in response to wdfink)1 of 1 people found this helpfulHi Wolf-Dieter Fink,
Thanks for answering! I understand your point with regards to the EJB specification and the interceptor lifecycle. It makes sense that the interceptor is created and destroyed with the bean instance. But I still don't find the relation to the non-application provided interceptors. Anyways - I am happy to inform you (and others in my situation) that ...
I found a JBoss 7.2 / Wildfly specific solution to this: Container Interceptors.
Documentation can be found here: https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Development_Guide/sect…
Using Container Interceptors I can place an "application interceptor" before all the JBoss AS default interceptors (security, tx, cdi, etc).
Unfortunately for me, the following happens: Upon shutdown (ctrl+c) of the server this chain is reduced to exclude my custom Container Interceptor(s). What this means is that... I still cannot intervene.
Anyways - for anybody who just want to intercept security exceptions, tx exceptions etc - Container Interceptors is the way....
-
3. Re: EJB "shutdown exception" is not caught by EJB interceptors
wdfink Jan 24, 2014 4:06 PM (in response to nmoelholm)1 of 1 people found this helpfulYes you are right, but as you mentioned this will not work as the container will check whether the deployment is in shutdown-state.
BTW you should mark the helpful answers and he thread as asumed answered" to help other find informations.