• 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
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!