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

Moderator: admin

Post Reply
gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

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

Post by gurpreet_asrgndu »

the explanation that you gave for first option(for onMessage) cant that explanation apply to lifecycle callback interceptor methods ?? why ?

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

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

Post by sanju.ait@gmail.com »

Seems like we can throw application exception from life cycle callback interceptors also the same way thrown by onMessage method.

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

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

Post by admin »

Option 1 is talking about MDB while option 3 is talking about all the beans in general. As per section 12.5.1 :
Lifecycle callback interceptor methods may throw system runtime exceptions, but not application exceptions.
HTH,
Paul.

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

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

Post by sanju.ait@gmail.com »

public class MyEx extends IOException{}

Is MyEx is application exception?

Or is it always necessary to annotate it with @ApplicationException to make it application exception?

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

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

Post by admin »

In your example MyEx is an application exception. @ApplicationException is not required if the exception is a checked exception.

HTH,
Paul.


amaebi
Posts: 4
Joined: Wed Jul 02, 2014 2:00 am
Contact:

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

Post by amaebi »

Since "Session bean business method is allowed to throw system exception." was not a valid answer, I think the option can be amended to "Session bean business method is allowed to [only] throw system exception."

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

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

Post by admin »

Amaebi, it is a valid answer.

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

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

Post by ramy6_1 »

Hello ,

In the second option "Business method interceptor methods may throw runtime exceptions ......"

What this option mean here by business method interceptor methods , please give an example.

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

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

Post by admin »

You can specify interceptor classes for business methods of a bean. It is talking about methods of those interceptor classes. Please see section 4.3.13 of EJB 3.1 specification for details.

HTH,
Paul.

supafly
Posts: 13
Joined: Mon Apr 18, 2016 2:05 pm
Contact:

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

Post by supafly »

The explanation to option 4 should mention that in case the business method throws a system exception the bean instance is discarded (if it is not a Singelton).

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests