This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Spark in Action and have Jean-Georges Perrin on-line!
See this thread for details.
Win a copy of Spark in Action this week in the Open Source Projects 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

mock question

Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following methods will cause an IllegalStateException when used from within the message-driven bean onMessage() method? [Check all correct answers]


Correct answers given are 1, 4 and 5.

But if you see API for EJBContext interface, this exception is NOT specified in throws clause for isCallerInRole() and getCallerPrincipal() methods.
Comments please.

Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.ejb.IlleglStateException is a unchecked exception. (So you dont have to declare it in a throws clause explicitly). This exception is thrown when you call a method of the EJBContext interface where you dont have access to the method you called. Eg. Calling getRollBackOnly() from a BMT MDB.

If you need further clarification and u r in reach of HFEJB read the exceptions chapter which will make it clear to u.

Best of Luck

Lahiru Abeydeera
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic