All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.ejb.EJBException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----javax.ejb.EJBException

public class EJBException
extends Exception
The EJBException exception is thrown by an enterprise Bean instance to its container to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database connection).

The enterprise Bean provider should provide a detailed descriptive message as part of the exception string. The container should log all reported EJBExceptions and make them available to the system administrator.

If a client-invoked method cannot not be completed because an instance has thrown the EJBException, the container must throw the java.rmi.RemoteException, or an exception that is a subclass of java.rmi.RemoteException, to the client.

If the EJBException was thrown by an instance while the instance performed work in the scope of a transaction that was initiated by the container, the container must rollback the transaction before throwing the java.rmi.RemoteException to the client.

If the EJBException was thrown by an instance while the instance performed work in the scope of a transaction that was imported from the client, the container must mark the transaction for rollback and throw the javax.jts.TransactionRollbackedException to the client. The javax.jts.TransactionRollbackedException is a subclass of java.rmi.RemoteException, and it indicates to the client that it would be fruitless to continue work in the scope of the transaction.


Constructor Index

 o EJBException()
Constructs an EJBException with no detail message.
 o EJBException(Exception)
Constructs an EJBException that embeds the originally thrown exception.
 o EJBException(String)
Constructs an EJBException with the specified detailed message.

Method Index

 o getCausedByException()
Obtain the exception that caused the EJBException being thrown.

Constructors

 o EJBException
 public EJBException()
Constructs an EJBException with no detail message.

 o EJBException
 public EJBException(String message)
Constructs an EJBException with the specified detailed message.

 o EJBException
 public EJBException(Exception ex)
Constructs an EJBException that embeds the originally thrown exception.

Methods

 o getCausedByException
 public Exception getCausedByException()
Obtain the exception that caused the EJBException being thrown.


All Packages  Class Hierarchy  This Package  Previous  Next  Index