This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes NoSuchEntityException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "NoSuchEntityException" Watch "NoSuchEntityException" New topic
Author

NoSuchEntityException

Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
NOTE: Pls ignore spaces, as those are required to post a message (1 word can not be more than 30 characters long)

Specs says:
18.3.4 javax.ejb. NoSuchEntityException
The NoSuchEntityException is a subclass of EJBException. If it is thrown by a method of an entity bean class, the Container must handle the exception using the rules for EJBException described in Sections 18.3.1, 18.3.2, and 18.3.3.

To give the client a better indication of the cause of the error, the Container should throw the java.rmi. NoSuchObjectException (which is a subclass of java.rmi. RemoteException) to a remote client, or the javax.ejb. NoSuchObjectLocalException to a local client.

My questions are as below:
1] When Entity bean instance throws NoSuchEntityException, does Container
throw java.rmi. NoSuchObjectException to remote client and javax.ejb. NoSuchObjectLocalException to a local client?

If not, does Container throw java.rmi. RemoteException to remote client and javax.ejb. EJBException to a local client and NoSuchEntityException is not related to java.rmi. NoSuchObjectException and javax.ejb. NoSuchObjectLocalException?

2] Can I infer that client would never get NoSuchEntityException directly unless Container implementation is designed to throw specific exceptions (Even in that case, only Local client would get NoSuchEntityException being sub-class of EJBException, right?)?

Pls clarify.

Regards,
Sandesh


Regards,<br />Sandesh<br />(SCJCP, SCWCD, SCBCD - 99%, OCP-1)<br /> <br />Either find a way or create one.
Sujatha Kumar
Ranch Hand

Joined: Jan 05, 2004
Posts: 134
Hi Sandash,


1] When Entity bean instance throws NoSuchEntityException, does Container
throw java.rmi. NoSuchObjectException to remote client and javax.ejb. NoSuchObjectLocalException to a local client?


Yes it is absolutely correct.


2] Can I infer that client would never get NoSuchEntityException directly unless Container implementation is designed to throw specific exceptions (Even in that case, only Local client would get NoSuchEntityException being sub-class of EJBException, right?)?


The remote client will receive java.rmi.NoSuchObjectException where as
the local client will receive javax.ejb.NoSuchObjectLocalException

Hope it helps.


SCJP,SCWCD,SCBCD,SCEA Part I
Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82


Thanks a lot.
 
GeeCON Prague 2014
 
subject: NoSuchEntityException