About Question enthuware.oce-ejbd.v6.2.540 :

Moderator: admin

Post Reply
sanju.ait@gmail.com
Posts: 38
Joined: Fri Aug 16, 2013 11:37 pm
Contact:

About Question enthuware.oce-ejbd.v6.2.540 :

Post by sanju.ait@gmail.com »

"the message listener method throws any exception." is also true.

Because this method can't throw checked exceptions, only option left is runtime exceptions, and that will be system runtime exception as checked application exception are also not allowed in throws block on message.

sanju.ait@gmail.com
Posts: 38
Joined: Fri Aug 16, 2013 11:37 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.540 :

Post by sanju.ait@gmail.com »

Any exception thrown in "PostConstruct" will lead to discard of instance and not MDB instance. MDB instance is a super-set of simple bean class instance, only after "PostConstruct" bean class instance is termed as proper MDB instance. So no point in discarding MDB instance when system exception is thrown from "PostConstruct" method, as in it wasn't even proper MDB instance.

admin
Site Admin
Posts: 10053
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.540 :

Post by admin »

1. You can annotate a runtime exception with @ApplicationException so a message listener can throw such an exception and still not be discarded.

2. The term MDB instance here is just referring to the instance of the bean class, which will indeed be discarded. This is a standard terminology.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests