Package javax.ejb
Class EJBException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.ejb.EJBException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AccessLocalException,ConcurrentAccessException,EJBAccessException,EJBTransactionRequiredException,EJBTransactionRolledbackException,NoSuchEJBException,NoSuchEntityException,NoSuchObjectLocalException,TransactionRequiredLocalException,TransactionRolledbackLocalException
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 Summary
ConstructorsConstructorDescriptionConstructs an EJBException with no detail message.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
Modifier and TypeMethodDescriptionObtain the exception that caused the EJBException being thrown.Returns the detail message, including the message from the nested exception if there is one.voidPrints the composite message toSystem.err.voidPrints the composite message and the embedded stack trace to the specified streamps.voidPrints the composite message and the embedded stack trace to the specified print writerpw.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Constructor Details
-
EJBException
public EJBException()Constructs an EJBException with no detail message. -
EJBException
Constructs an EJBException with the specified detailed message. -
EJBException
Constructs an EJBException that embeds the originally thrown exception. -
EJBException
Constructs an EJBException that embeds the originally thrown exception with the specified detail message.
-
-
Method Details
-
getCausedByException
Obtain the exception that caused the EJBException being thrown. -
getMessage
Returns the detail message, including the message from the nested exception if there is one.- Overrides:
getMessagein classThrowable
-
printStackTrace
Prints the composite message and the embedded stack trace to the specified streamps.- Overrides:
printStackTracein classThrowable- Parameters:
ps- the print stream
-
printStackTrace
public void printStackTrace()Prints the composite message toSystem.err.- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints the composite message and the embedded stack trace to the specified print writerpw.- Overrides:
printStackTracein classThrowable- Parameters:
pw- the print writer
-