wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes RemoteException in EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "RemoteException in EJB" Watch "RemoteException in EJB" New topic
Author

RemoteException in EJB

Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
Can the bean itself throw a RemoteException?. According to HFE, if the bean throws a system Exception(unchecked/runtime), then the container gets the exception and throws to the client as a "RemoteException". So , here the container is throwing the RemoteException.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

Can the bean itself throw a RemoteException?

NO. According to the specification, the bean itself cannot throw RemoteException.

If the bean is serving a local client and throws a system exception, the container will wrap it into EJBException, and rethrows this to the client. If the bean is serving a remote client and throws a system exception, the container will wrap it into RemoteException, and rethrows this to the client.


According to HFE, if the bean throws a system Exception(unchecked/runtime), then the container gets the exception and throws to the client as a "RemoteException". So , here the container is throwing the RemoteException.

YES. This is exactly what the container does.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RemoteException in EJB
 
Similar Threads
Mock Question HFEJB page 520. Q3.
a thumb of rule of Exception
client calling remove() twice
System exception in a BMT
HFEJB - pag 564 - exception question