• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Veletin's Cheet Sheets

 
Ranch Hand
Posts: 493
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be I am missing something, but why do the container callback methods such as ejbActivate, ejbPassivate, ejbRemove, ejbsetSessionContext, etc. are shown to throw both RemoteException, and EJBException? Head First EJB expressly advises against allowing the container callbacks to throw both Remote And EJB exceptions.
May be I am not reading the cheet-sheets right?
Will appreciate somebody clarifying this.
Thanks.
Bharat
[ December 22, 2003: Message edited by: Bharat Ruparel ]
 
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
The answer is simply because my cheat sheets reflect what stands in the EJB 2.0 specification and J2EE 1.3 APIs. The reason why both exceptions are included in the method declarators is simply to ensure backward compatibility with previous EJB specification.
If you go in the API you will see the following:


java.rmi.RemoteException - This exception is defined in the method signature to provide backward compatibility for applications written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.


I hope this clears your doubts
 
Your mother is a hamster and your father smells of tiny ads!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic