javax.ejb
public class: EJBException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.ejb.EJBException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessLocalException, TransactionRequiredLocalException, NoSuchEntityException, NoSuchObjectLocalException, NoSuchEJBException, TransactionRolledbackLocalException, EJBAccessException, EJBTransactionRolledbackException, EJBTransactionRequiredException, ConcurrentAccessException
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).
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from javax.ejb.EJBException Detail: |
public Exception getCausedByException() {
return causeException;
}
Obtain the exception that caused the EJBException being thrown. |
public String getMessage() {
String msg = super.getMessage();
if (causeException == null)
return msg;
else if ( msg == null ) {
return "nested exception is: " + causeException.toString();
}
else {
return msg + "; nested exception is: " + causeException.toString();
}
}
Returns the detail message, including the message from the nested
exception if there is one. |
public void printStackTrace() {
printStackTrace(System.err);
}
Prints the composite message to System.err. |
public void printStackTrace(PrintStream ps) {
if (causeException == null) {
super.printStackTrace(ps);
} else {
synchronized(ps) {
ps.println(this);
// Print the cause exception first, so that the output
// appears in stack order (i.e. innermost exception first)
causeException.printStackTrace(ps);
super.printStackTrace(ps);
}
}
}
Prints the composite message and the embedded stack trace to
the specified stream ps. |
public void printStackTrace(PrintWriter pw) {
if (causeException == null) {
super.printStackTrace(pw);
} else {
synchronized(pw) {
pw.println(this);
// Print the cause exception first, so that the output
// appears in stack order (i.e. innermost exception first)
causeException.printStackTrace(pw);
super.printStackTrace(pw);
}
}
}
Prints the composite message and the embedded stack trace to
the specified print writer pw. |