• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on exception(HF P559)

 
Yi Si
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF 559
client scenarious:
"When client calls remove() on a bean that's already been removed
The client will receive RemoteException/EJBException"
Even though such statement is right
(NoSuchObjectException is subclass of RemoteException)
I want to know why container not send more specific exception (NoSuchObjectException/NoSuchObjectLocalException) to client,
Does such case depend on container vendor?
[ February 12, 2004: Message edited by: si yi ]
 
Ashish Sarin
author
Ranch Hand
Posts: 444
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that is correct. It depends upon the container implementation. It is recommended that more specific exceptions should be thrown to the client but it depends only on the container implementation.
regards
ashish sarin
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would prefer to refer to the EJB spec.
Section 6.7.1

It is invalid to reference a session object that does not exist. Attempted remote invocations on a session object that does not exist result in 'java.rmi.NoSuchObjectException'

So the spec DOES require 'java.rmi.NoSuchObjectException' be thrown rather than up to the vendor. See section 6.7.2 for similar requirement on local session object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic