• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

ejbCreate & CreateException for CMP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi fellow nitpickers. Agreed it's pretty trival and,
honestly, I've searched this forum and the errata but..
-the EJB 2.0 Spec (Final Release Aug 14 2001) states
in section 10.6.4 ejbCreate<METHOD> methods (for CMP that)
'The throws clause *must* define the javax.ejb.CreateException.'
- Head First EJB (Oct 2003 First Ed) says on p333 Rules for ejbCreate
'You *may* declare a throws clause with CreateException'
The code examples on pp316,318,331,335 have no such exception.
Presumably the Spec is the definitive answer but is one really
expected to know such details for the exam? Frightening.
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed that too. Not sure if it is a rule, or just bad wording of that portion of the spec. CreateException is an application exception, and other parts of the spec have the usual discussion about exceptions declared in the implementation method need to be declared in the appropriate interfaces. That CreateException rule seemed an odd departure.
 
David O'Brien
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reid
I tested this point on the Sun 1.4 RI and omitting
the CreateException on ejbCreate gives a deploy error
to that effect. HoweverI'm not downloading 1.3 just
to confirm.
I guess the point is to regard the Spec as the definitive
statement even if it seems odd or contradicts other sources.
It would be pleasing to have this paticular discrepancy
between the spec and the Head First EJB text confirmed.
Ordinarily there seems little point in raising a simple
typo where there is no risk of misunderstanding e.g on p304
the call to ejbSelectGetAllMovies has no argument but the
corresponding EJB QL uses a parameter.
However compilers of mock, and perhaps real, exam questions
seem, for some reason, to be very keen on the exceptions raised
by methods and their optionality e.g p290 Q10, p363 Q5, Q6
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic