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

Moderator: admin

Post Reply
jszczepankiewicz

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

Post by jszczepankiewicz »

In the 3rd explanation there is: "Lifecycle callback interceptor methods may throw system runtime exceptions, but not application exceptions. A runtime exception (system exceptions are RuntimeExceptions) thrown by any lifecycle interceptor callback method causes the bean instance and its interceptors to be discarded after the interceptor chain unwinds.".

the question is about "lifecycle callback method", but the explanation describes only lifecycle callback method in context of the interceptor. I suggest to refine the explanation to add information about standard lifecycle callback method (i.e. @PostConstruct on the session bean).

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

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

Post by admin »

EJB 3.1 specification calls all life cycle callback methods as lifecycle callback interceptor methods because such methods can be defined directly on the bean class or on a separate interceptor class. The rules are same irrespective of where they are defined.

This clarification has now been added to the explanation.

thanks for your feedback!
If you like our products and services, please help us by posting your review here.

mopuffus
Posts: 22
Joined: Thu Jul 25, 2013 3:39 pm
Contact:

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

Post by mopuffus »

The question
Identify the correct statements about a life cycle callback method.
with the answer
It can only throw system exceptions.
is wrong.

A system exception can be a checked exception annotated with @SystemException. A life cycle callback can throw only unchecked system exception (or runtime system exception).
The proper text for the answer can be like this: It can only throw runtime/unchecked system exceptions.

I choose then right answer only because all the other option was wrong and the actual answer is as close as possible to the specifications.

Best Regards,
Mihai

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

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

Post by admin »

I am unable to find this SystemException annotation anywhere. Can you please post a link of where you saw this?

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

kezman9
Posts: 26
Joined: Fri Jul 06, 2012 1:08 am
Location: Poland
Contact:

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

Post by kezman9 »

Hi Mihai,

According to spec:
A system exception is an exception that is a java.rmi.RemoteException (or one of its subclasses) or a RuntimeException that is not an application exception
And application exception is:
An application exception may be a subclass (direct or indirect) of java.lang.Exception (i.e., a “checked exception”), or an application exception class may be defined as a subclass of the java.lang.RuntimeException (an “unchecked exception”). An application exception may not be a subclass of the java.rmi.RemoteException. The java.rmi.RemoteException and its subclasses are reserved for system exceptions.
So your definition is unfortunately not true. I also have not found annotaion @systemexception. There is of course @ApplicationException one. Please post the link as Paul mentioned.

Thanks,
J

mopuffus
Posts: 22
Joined: Thu Jul 25, 2013 3:39 pm
Contact:

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

Post by mopuffus »

Thanks guys, it was my failure, I was inventing an annotation (the @SystemException).
Now everything is clear to me.

Thanks a lot !!!!

Post Reply

Who is online

Users browsing this forum: No registered users and 101 guests