Can someone clarify when you will get an IllegalStateException and when you will get a Remote/Ejb exception? It seems one case is when you need a transaction to call a method and there is no transaction, or when BMT methods are used in CMT beans or vice versa. Are there any other situations?
posted 11 years ago
In the spec there are somethings related to CMP beans. I havent read it yet so cant explain it now. but refer to chapter 10 of the spec.
IllegalStateException is usually associated with calling a method on the EJB context that you shouldn't be calling. For example, you can't call getUserTransaction() from a CMT bean. You can't call getCallerPrincipal() from a Message-Driven Bean.