Thanks for Frits' suggestion.
I guess
checks if the
proxy of the stateless bean is null or not. But
this does not check if the actual stateless bean has been discarded or not.
In the servlet client, I used
after the interceptor throws the runtime exception.
The output is an EJBException as the statelessBeanA has been discarded by the container after the exception is thrown from the interceptor.
For the information:
LogInterceptor1 - entering method: method1
Info: This is a demo, it does nothing.
Warning: A system exception occurred during an invocation on EJB StatelessSessionBeanA method public void com.ivan.scbcd6.StatelessSessionBeanA.method1()
javax.ejb.EJBException
....
at com.ivan.scbcd6.__EJB31_Generated__StatelessSessionBeanA__Intf____Bean__.method1(Unknown Source)
at com.ivan.scbcd6.client.SingletonClientServlet.doGet(SingletonClientServlet.java:39)
...
Caused by: java.lang.RuntimeException
at com.ivan.scbcd6.LogInterceptor1.log(LogInterceptor1.java:17)
...