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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
ETS User

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

Post 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.

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

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

Post 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.
If you like our products and services, please help us by posting your review here.

Guest

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

Post 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

deadlock_gr
Posts: 54
Joined: Tue Apr 19, 2011 10:32 am
Contact:

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

Post by deadlock_gr »

The "None of the above" answer would only be meaningful for questions with only one answer :-)

supergiu
Posts: 8
Joined: Thu Sep 25, 2014 2:48 pm
Contact:

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

Post 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.

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

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

Post by admin »

You are right. It can be interpreted that way. Fixed.

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

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

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

Post by ramy6_1 »

Hello ,

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

I expect remote client to receive remote exception.

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

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

Post 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.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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.

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

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

Post by admin »

You are right. Fixed.
thank you for your feedback!
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 7 guests