• 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!