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

HF EJB Book - Page 554 & 559 - Clarification required

 
Balasubramaniam K.R
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First client scenario
"Client calls remove() on a bean that's already bean removed."
It is mentioned as RemoteException for remote client and EJBException for local client.
My understanding from HF EJB page 554
In remote client, ideally it should throw "java.rmi.NoSuchObjectException" which is subclass of "java.rmi.RemoteException" - Right
In local client, ideally it should throw "javax.ejb.NoSuchObjectLocalException" which is subclass of "java.ejb.EJBException" - Right
Some one please clarify.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Balasubramaniam,
Welcome to JavaRanch and this forum !
You are right, but there is no contradiction between p559 and p554. As you recall yourself, NoSuchObjectException *IS-A* RemoteException and NoSuchObjectLocalException *IS-A* EJBException. So what's stated on p559 is just less precise, but is correct.
Regards,
Phil.
[ December 31, 2003: Message edited by: Philippe Maquet ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- the issue here is that the spec basically says (although not in these exact words ): "OK Container, it would be NICE of you to throw the more specific NoSuchObjectException or NoSuchLocalObjectException, but you are not REQUIRED to do so. You can be less clear and just throw a RemoteException or EJBException if you choose..."
So, the client *might* get the more specific exception, but it is the Container's choice.
cheers,
Kathy
 
Balasubramaniam K.R
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kathy,
Now I understood that it is based on the container implementation, whether to give more specific "NoSuchObjectException" or just super "RemoteException".
With weblogic 6.1 container implementation I got specific exception java.rmi.NoSuchObjectException, for remote client call.
Wish you all a very happy new year 2004.
Cheers,
Balu
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 566 it says, under question 2, it indicates that "NoSuchObject" will be thrown if blah blah blah. Based on the above discussion, I think this question should read "may be thrown..."
Also, I'm thinking that 559 should say something to indicate that the container may send the remote client a "RemoteException" or something that extends it. A similar addition would also be in order for the local client.
--Dale--
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic