• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Session bean methods throw RemoteException

 
Rajesh So
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The Enterprise Bean lives inside a container and is not 'directly' involved in Remote capabilities. It is not a java.rmi.Remote object too. It is a passive object, that is exclusively for and under the operation of the EJBObject/Container.

If the purpose of them throwing RemoteException is, they are 'indirectly' involved for Remote Operations, then every object that are inside the Container space should be throwing Remote Exceptions.

In that case, why do Entity Bean and Session Bean methods throw Remote Exceptions.

Please help me understand the concept.

Thanks in advance,
Rajesh
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RemoteException must be declared in the methods of the remote interface and remote home interface.

RemoteException must not be declared in the methods of the bean class.

It is the container-generated classes that implement the interfaces which have the methods that declare RemoteException.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic