Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

HF EJB Book - Page 554 & 559 - Clarification required

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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--
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic