Package javax.ejb

Class EJBException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessLocalException, ConcurrentAccessException, EJBAccessException, EJBTransactionRequiredException, EJBTransactionRolledbackException, NoSuchEJBException, NoSuchEntityException, NoSuchObjectLocalException, TransactionRequiredLocalException, TransactionRolledbackLocalException

public class EJBException extends RuntimeException
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).
See Also:
  • Constructor Details

    • EJBException

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

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

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

      public EJBException(String message, Exception ex)
      Constructs an EJBException that embeds the originally thrown exception with the specified detail message.
  • Method Details

    • getCausedByException

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

      public String getMessage()
      Returns the detail message, including the message from the nested exception if there is one.
      Overrides:
      getMessage in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream ps)
      Prints the composite message and the embedded stack trace to the specified stream ps.
      Overrides:
      printStackTrace in class Throwable
      Parameters:
      ps - the print stream
    • printStackTrace

      public void printStackTrace()
      Prints the composite message to System.err.
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintWriter pw)
      Prints the composite message and the embedded stack trace to the specified print writer pw.
      Overrides:
      printStackTrace in class Throwable
      Parameters:
      pw - the print writer