This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Thorwn Exception of local  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Q3 HFEJB Page 425
When a remote client invokes a method on an entity bean using container-managed persistence, and that bean has already beean removed ,what exception will be thrown?
ans java.rmi.NoSuchObjectException

As case.If local client called method ? what exception will be thrown?

would you please advice me
Thank a lot for your kindly advice
 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.ejb.NoSuchObjectLocalException
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
local clients will get javax.ejb.NoSuchObjectLocalException
remote clients will get javax.ejb.NoSuchObjectException

Bye
Amol.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HJEJB Page 425, Question 3:
When a remote client invokes a method on an entity bean using container-managed persistence, and that bean has already been removed, what exception will be thrown?



I'm not challenging the provided solution. What I'm trying to say here is that the question is rather unclear here. Were they looking for the exception thrown by the bean or by the container?

If it was asking for the exception thrown by the container, the provided solution is obviously correct.

But I could also argue that the bean throws NoSuchEntityException, and that is also correct. Moreover, the question did not state what method was invoked. It could be remove, ejbLoad, ejbStore or any business methods defined in the component interface.

But of course to the client, it could see RemoteException/EJBException or the more specific NoSuchObjectException/NoSuchObjectLocalException.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!