• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in remote exceptions

 
Sajid Moinuddin
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
According to the spec, any local home/component interface "must not throw remote exception" or it's subclasses. But in sun 1.3 ri, if I throw remote exception in my method signatures of local home/component interface, I don't get any error. Can I throw 'em in my bean classes? what's the rule of thumb??
Regards,
Sajid
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compiler doesnt care if you throw RemoteException in local home or local component interface. But I am sure that will get fail at bean deployment time.
 
Michael Valentino
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is legal as far as the java language goes to throw a remote exception from the local/local home interfaces, but it's not legal according to the EJB specification. A good container/tool will verify this and let you know before deployment, and almost all containers will fail AT deployment.

when studying for the exam, if you see "you cannot do X for this situation" they're almost always saying that "even if X is legal in the java language, it's not legal in the EJB spec. Do don't do it".
 
Michael Valentino
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is legal as far as the java language goes to throw a remote exception from the local/local home interfaces, but it's not legal according to the EJB specification. A good container/tool will verify this and let you know before deployment, and almost all containers will fail AT deployment.

when studying for the exam, if you see "you cannot do X for this situation" they're almost always saying that "even if X is legal in the java language, it's not legal in the EJB spec. Do don't do it".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic