Win a copy of Serverless Applications with Node.js this week in the NodeJS 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

mock question  RSS feed

 
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]


1)getEJBHome()
2)getRollbackOnly()
3)getUserTransaction()
4)isCallerInRole()
5)getCallerPrincipal()

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.

Thanks,
Prashant
 
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
www.lordhiru.tk
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!