About Question enthuware.oce-ejbd.v6.2.458 :
Moderator: admin
-
- Posts: 55
- Joined: Thu Jan 03, 2013 7:51 am
- Contact:
About Question enthuware.oce-ejbd.v6.2.458 :
the explanation that you gave for first option(for onMessage) cant that explanation apply to lifecycle callback interceptor methods ?? why ?
-
- Posts: 38
- Joined: Fri Aug 16, 2013 11:37 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
Seems like we can throw application exception from life cycle callback interceptors also the same way thrown by onMessage method.
Online
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
Option 1 is talking about MDB while option 3 is talking about all the beans in general. As per section 12.5.1 :
Paul.
HTH,Lifecycle callback interceptor methods may throw system runtime exceptions, but not application exceptions.
Paul.
-
- Posts: 38
- Joined: Fri Aug 16, 2013 11:37 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
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?
Is MyEx is application exception?
Or is it always necessary to annotate it with @ApplicationException to make it application exception?
Online
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
In your example MyEx is an application exception. @ApplicationException is not required if the exception is a checked exception.
HTH,
Paul.
HTH,
Paul.
-
- Posts: 38
- Joined: Fri Aug 16, 2013 11:37 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
Thanks a lot Paul
-
- Posts: 4
- Joined: Wed Jul 02, 2014 2:00 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
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."
Online
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
Amaebi, it is a valid answer.
-
- Posts: 124
- Joined: Wed Feb 12, 2014 2:44 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
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.
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.
Online
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
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.
HTH,
Paul.
-
- Posts: 13
- Joined: Mon Apr 18, 2016 2:05 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.458 :
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).
Who is online
Users browsing this forum: No registered users and 1 guest