Page 1 of 1

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

Posted: Mon Apr 25, 2011 12:15 am
by ETS User
EjbException is not a subclass of of RemoteException, so why is that answer correct??:

Which of the following actions is appropriate when a bean method throws an exception to a remote client?

The client must be prepared to handle EJBException if thrown by the container.
Note: Remote clients get java.rmi.RemoteException if the Business Interface extends java.rmi.Remote.

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

Posted: Mon Apr 25, 2011 6:23 am
by admin
The given answer is correct because a business interface does not necessarily have to extend java.rmi.Remote since EJB 3.x. That is why a remote client can get EJBException.
As the explanation says, java.rmi.RemoteException is thrown only if the business interface extends java.rmi.Remote. It is just providing you additional information.

thank you.

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

Posted: Mon Apr 25, 2011 2:09 pm
by Guest
ok thx, then it might be useful to write:

Note: Remote clients get java.rmi.RemoteException ONLY if the Business Interface EXTENDS java.rmi.Remote.

I thought putting the @Remote Annotation is like extending the Remote interface

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

Posted: Tue May 10, 2011 4:24 pm
by deadlock_gr
The "None of the above" answer would only be meaningful for questions with only one answer :-)

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

Posted: Thu Oct 09, 2014 1:07 pm
by supergiu
Hi,
sorry but about this sentence:
The client must be prepared to handle EJBException if thrown by the container.
I think that must be:
The client can be prepared to handle EJBException if thrown by the container.
.
because javax.ejb.EJBException is an unchecked exception and from oracle - java documentation:
http://docs.oracle.com/javase/tutorial/ ... ntime.html
...the API client code cannot reasonably be expected to recover from them or to handle them in any way.
Even though it is irrelevant on J2EE issues, it is related to java language and in my opinion it should be respected.
Thank you.

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

Posted: Thu Oct 09, 2014 7:38 pm
by admin
You are right. It can be interpreted that way. Fixed.

thank you for your feedback!

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

Posted: Thu Dec 04, 2014 9:42 am
by ramy6_1
Hello ,

Can you please specify when exactly remote client can receive EJBException ?

I expect remote client to receive remote exception.

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

Posted: Thu Dec 04, 2014 9:33 pm
by admin
There could be several situations where java.rmi.RemoteException may be received by a client but you need to check the EJB specification to look for such cases (not important for exam) because the specification has moved away from it. In general, a client will receive it, only if the business interface is a remote business interface that extends java.rmi.Remote, which itself is not recommended anymore.

HTH,
Paul.

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

Posted: Fri May 01, 2015 1:28 pm
by himaiMinh
In the explanation of option 4, "A runtime exception is a system exception and is translated to a RemoteException thrown the client."

I think the remote client won't get RemoteExeption. The client will get EJBException instead.
As the spec 14.3.12 says, RemoteException has been deprecated since EJB 1.1.

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

Posted: Fri May 01, 2015 8:44 pm
by admin
You are right. Fixed.
thank you for your feedback!