Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException

 
sandeep vaid
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public interface EJBContext {
EJBHome getEJBHome();
EJBLocalHome getEJBLocalHome();
Principal getCallerPrincipal();
boolean isCallerInRole(String roleName);
UserTransaction getUserTransaction() throws IllegalStateException;
void setRollbackOnly() throws IllegalStateException;
boolean getRollbackOnly() throws IllegalStateException;
}


Here in
Principal getCallerPrincipal();
boolean isCallerInRole(String roleName);

There is no throws class that cantains IllegalStateException so how come it can thro this type of exception if called on MDB's.


Thanks!!
Sandy
 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandy,

I think you are talking about java.lang.IllegalStateException.

Note that java.lang.IllegalStateException is runtime exception and not a checked one. So one is not required to declare it in throws clause.

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!