• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception qustion in HFEJB

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page. 564 #4
Which of the following are EJB 2.0 specification guidelines regarding system exception?
.
.
B. Bean methods should wrap unrecoverable checked exception in a javax.ejb.EJBException exception.
C. For remote clients, bean methods should wrap unrecoverable checked exception in a java.rmi.RemoteException.

Answer is B only.

Why c is not correct? I know checked exception includes RemoteException, and container will handle that, no problem here. But there might not other unrecoverable checked exceptions, you will want to let container handle the rollback, clean up process by wrapping them up as RemoteException. :roll:

Thanks
Shiang
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As of the EJB 2.0 specification, the bean methods are not allowed to declare (and throw) RemoteException anymore. Check out section 18.2.2 (System exceptions) of the EJB 2.0 specification which clearly explains how beans should process unrecoverable error conditions.
 
Shiang Wang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I was confused by the role of bean provider and the client. Bean providers should wrap it up as EJBException NO MATTER WHAT, clients will receive them differently depends on whether it is remote or local.

Shiang
 
I think she's lovely. It's this tiny ad that called her crazy:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic