javax.ejb
Class EJBException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.ejb.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:
Serialized Form

Constructor Summary
EJBException()
          Constructs an EJBException with no detail message.
EJBException(Exception ex)
          Constructs an EJBException that embeds the originally thrown exception.
EJBException(String message)
          Constructs an EJBException with the specified detailed message.
EJBException(String message, Exception ex)
          Constructs an EJBException that embeds the originally thrown exception with the specified detail message.
 
Method Summary
 Exception getCausedByException()
          Obtain the exception that caused the EJBException being thrown.
 String getMessage()
          Returns the detail message, including the message from the nested exception if there is one.
 void printStackTrace()
          Prints the composite message to System.err.
 void printStackTrace(PrintStream ps)
          Prints the composite message and the embedded stack trace to the specified stream ps.
 void printStackTrace(PrintWriter pw)
          Prints the composite message and the embedded stack trace to the specified print writer pw.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.