Useful points on exceptions in ejb 2.0

Just thought that the following points in regards to the exceptions could be useful for the exam preparations:

1. When a session or entity bean call getEJBHome/getEJBObject on SessionContext/EntityContext and the bean does not have a remote interface defined - Container throws java.lang.IllegalStateException

2. When a session or entity bean call getEJBLocalHome/getEJBLocalObject on SessionContext/EntityContext and the bean does not have a local interface defined - Container throws java.lang.IllegalStateException

3. Client gets RemoveException when a. remove() is called on SFSB that is in a transaction (BMT sfsb) b. remove(Object pk) is called on a session bean remote/local home intf c. application level error occurred in ejbRemove() method of the entity bean

6. Container throws IllegalStateException when bean calls methods on EJBContext that are not allowed (eg, getEJBObject() from setSessionContext()) or when tried to reset pk, or when performing prohibited operation on java.util.Collection API that represents a cmr-field)

7. When a bean attempts to access a resource manager or other beans and the access is not allowed (accessing a resource in ejbActivate() of entity bean) the behaviour is undefined by ejb spec