• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

ejbCreate & CreateException for CMP

Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic