Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What Exception does the EJBCOntainer Throw

 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when the remote client does not have access to a Business Method.
Is this the same as the client not having permission to call the method.
Thanks
Sumit
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You get RemoteException thrown if the client, using a stub to a valid EJB Object, invokes remove or any other business method on a bean that's already been removed.
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a bean has been removed and the client tries to call any methods on this bean, the Container will throw NoSuchObject(Local)Exception to the client. Check spec 18.3.5 pg 379.
Joyce
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a bean has been removed and the client tries to call any methods on this bean, the Container will throw NoSuchObject(Local)Exception to the client. Check spec 18.3.5 pg 379.

Actually, the spec says that the Container should throw NoSuchObjectException for a remote client, but must throw RemoteException. So, it's up to the Container vendor to decide whether to throw the more helpful NoSuchObjectException or the less helpful RemoteException.
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Roger Chung-Wee:

Actually, the spec says that the Container should throw NoSuchObjectException for a remote client, but must throw RemoteException. So, it's up to the Container vendor to decide whether to throw the more helpful NoSuchObjectException or the less helpful RemoteException.

Oops! I gave a bad reference. But if you do a search for NoSuchObjectException throughout the spec (esp the session and entity bean sections), the spec mentions the Container must/will throw NoSuchObjectException.
Joyce
[ April 27, 2004: Message edited by: Joyce Lee ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic