a question from enthuware mock kit has an option that goes like this. We have to choose correct.
OPTION A - onMessage() of a Message Driven Bean is not allowed to throw application exceptions.
EXPLANATION : It can throw application exceptions. However, since onMessage() cannot throw checked exceptions, the only way to throw an application is to throw a subclass of RuntimeExcecption and annotate with @ApplicationException.
can we apply the same explanation for lifecycle callback interceptor methods ? why ?
can we apply the same explanation for lifecycle callback interceptor methods ?
A MDB is not allowed to throw an Application Exception from a lifecycle callback interceptor method.
14.3.5 Exceptions from PostConstruct and PreDestroy Methods of a Message-Driven Bean
Bean method condition | Bean method exception | Container action
Bean is message-driven bean | System exceptions | Log the exception or error. Discard instance.
In fact all lifecycle callback methods (not only for MDB's) are not allowed to throw an application exception. (check the table ch. 6.4 Handling of exceptions in my notes)
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop