Win a copy of Fixing your Scrum this week in the Agile 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Does Session bean's createMETHOD in home interface must throw "CreateException"?

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, all
I think it's ambigous because in "7.10.3 ejbCreate<METHOD> methods", EJB spec 2.0, it says:

The throws clause may define arbitrary application exceptions, possibly including the
javax.ejb.CreateException.


In my opinion, the CreateException is optional. However, according to An SCBCD certification primer, the second question:


Consider the following session bean home interface located through the Java Naming and Directory Interface (JNDI).
Context initialContext = new InitialContext();
ProcessPaymentHome ppHome = (ProcessPaymentHome)
initialContext.lookup(�java:comp/env/ejb/pphome�);
Which exceptions must be declared in the signatures of the methods contained in the ProcessPaymentHome interface?
Choices
A. RemoteException
B. FindException
C. Any application specific exception
D. CreateException
E. RuntimeException
Correct choice:
C; D


It assert that the CreateException is mandatory for create<METHOD> in session bean's home interface...
 
hover cheng
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer my own old question
The CreateException need not to be defined to be thrown in the home interface for session bean.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The rule you have stated is regarding the ejbCreate() methods in the session bean class. However, in the case of create() methods in the home interface of a session bean, the specification clearly states:
"The throws clause must include javax.ejb.CreateException".
Please check out Section 7.10.8 of the Specs.
Thanks
seema
[ October 15, 2003: Message edited by: seema manivannan ]
 
hover cheng
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
seema,
You are right. Thanks for your correction.
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic