[jboss-user] [EJB 3.0] - RuntimeExceptions caught, wrapped in EJBException
do-not-reply at jboss.com
Sun Jan 7 17:12:18 EST 2007
So whenever the container encounters a RuntimeException, it's wrapped and rethrown to the client as an EJBException. This behaviour can be overridden by annotating the RuntimeException with @ApplicationException.
But what about cases where the RuntimeException is not a custom one? Whenever a NullPointer, ArrayIndexOutOfBounds, etc is encountered, the container is rethrowing these as an EJBException to the client alone, silently swallowing the server error. I want to know if the server encounters an unchecked, undeclared exception in any of my service methods. Namely, I've configured Log4J to email me.
Anyone have experience dealing with this? How do you address it? Can I globally catch these with an interceptor, run "logger.error()", and rethrow?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998788#3998788
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998788
More information about the jboss-user