• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RemoteException in EJB

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic