Exception Handling In Ejb Page 2

ADVERTISEMENT

Exception Handling in EJB 2.0
Exception
Package
Runtime?
System?
Remote?
Parent?
Who throws?
Comments
NameNotFoundException
javax.
N
N
NamingException
Container
Component not bound to name
naming
Invalid EJB attempt to use UserTransaction 20.7
NoSuchEntityException
javax.ejb
Y
Y
N
EJBException
EntityBean
Thrown by ejbLoad/ejbStore; underlying entity
removed 18.2.2.1, 18.3.4
NoSuchObjectException
java.rmi
N
Y
Y
RemoteException
Container
Business method cannot complete because
EJBObject no longer exists 18.4.2.3
IIOP: map to OBJECT_NOT_EXIST 19.5.3
NoSuchObjectLocalException
javax.ejb
Y
Y
N
EJBException
Container
Business method cannot complete because
EJBObject no longer exists 18.4.2.3
NotSupportedException
javax.txn
N
N
Exception
Attempt to start new txn with UserTxn begin()
when previous txn not committed 17.6.1
ObjectNotFoundException
javax.ejb
N
N
N
FinderException
Container
Requested object does not exist 10.5.8.4
Used by single finder methods
Multi finder methods must not throw 10.5.8.4
Multi finder methods must return null
OperationNotSupported
javax.
N
N
NamingException
Container
Container must ensure EJB instances have only
Exception
naming
read access to their environment variables 20.2.4
RemoteException
java.rmi
N
Y
Y
IOException
Container
General remote exceptions 18.4.2
Deprecated for ejbCreate 7.10.3
Attempted loopback, re-entrant false 10.5.11
IIOP: map to UNKNOWN 19.5.3
RemoveException
javax.ejb
N
N
N
Exception
Both
Remove methods
No guarantee that entity was removed 10.5.8.5
RuntimeException
java.lang
Y
Exception
Container not required to implement EJB1.0 env
properties. Throw this if not supported 20.6
SecurityException
java.lang
Y
Y
N
RuntimeException
Bean
Security violation
Code sample for isCallerInRole() 21.2.5.2
TxnRequiredException
javax.txn
N
Y
Y
RemoteException
Container
Client doesn’t have necessary txn context 18.4.2.2
IIOP: map to TXN_REQUIRED 19.5.3
TxnRequiredLocalException
javax.txn
Y
Y
N
EJBException
Container
Client doesn’t have necessary txn context 18.4.2.2
TxnRolledBackException
javax.txn
N
Y
Y
RemoteException
Container
Txn marked for rollback 18.4.2.1
IIOP: map to TXN_ROLLEDBACK 19.5.3
TxnRolledBackLocalException
javax.txn
Y
Y
N
EJBException
Container
Txn marked for rollback 18.4.2.1
Eileen Sauer, Volantec.biz – eileen@volantec.biz
Page 2

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2