- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.eclipse.persistence.exceptions.EclipseLinkException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BeanValidationException,CommunicationException,ConcurrencyException,ConversionException,DatabaseException,DBWSException,DynamicException,EntityManagerSetupException,JAXBException,JPARSException,JPQLException,JSONException,OptimisticLockException,PersistenceUnitLoadingException,RemoteCommandManagerException,SDOException,ServerPlatformException,SessionLoaderException,StaticWeaveException,TransactionException,ValidationException,XMLConversionException,XMLParseException,XMLPlatformException
public abstract class EclipseLinkException extends RuntimeException
Purpose: Any exception raised by EclipseLink should be a subclass of this exception class.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCRprotected interrorCodeprotected booleanhasBeenLoggedprotected StringindentationStringprotected ThrowableinternalExceptionprotected org.eclipse.persistence.internal.sessions.AbstractSessionsessionprotected static BooleanshouldPrintInternalException
-
Constructor Summary
Constructors Modifier Constructor Description protectedEclipseLinkException()INTERNAL: Return a new exception.protectedEclipseLinkException(String theMessage)INTERNAL: EclipseLink exception should only be thrown by EclipseLink.protectedEclipseLinkException(String message, Throwable internalException)INTERNAL: EclipseLink exception should only be thrown by EclipseLink.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Stringcr()INTERNAL: Convenience method - return a platform-specific line-feed.intgetErrorCode()PUBLIC: Return the exception error code.StringgetIndentationString()INTERNAL: Used to print things nicely in the testing tool.ThrowablegetInternalException()PUBLIC: Return the internal native exception.StringgetMessage()PUBLIC: Return the exception error message.org.eclipse.persistence.internal.sessions.AbstractSessiongetSession()PUBLIC: Return the session.StringgetUnformattedMessage()INTERNAL:booleanhasBeenLogged()INTERNAL: Return if this exception has been logged to avoid being logged more than once.voidprintStackTrace()PUBLIC: Print both the normal and internal stack traces.voidprintStackTrace(PrintStream outStream)PUBLIC: Print both the normal and internal stack traces.voidprintStackTrace(PrintWriter writer)PUBLIC: Print both the normal and internal stack traces.voidsetErrorCode(int errorCode)INTERNAL:voidsetHasBeenLogged(boolean logged)INTERNAL: Set this flag to avoid logging an exception more than once.voidsetIndentationString(String indentationString)INTERNAL: Used to print things nicely in the testing tool.voidsetInternalException(Throwable exception)INTERNAL: Used to specify the internal exception.voidsetSession(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL:static voidsetShouldPrintInternalException(boolean printException)PUBLIC: Allows overriding of EclipseLink's exception chaining detection.static booleanshouldPrintInternalException()INTERNAL Check to see if the EclipseLink-stored internal exception should be printed in this a EclipseLinkException's stack trace.StringtoString()INTERNAL:-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
-
-
-
Field Detail
-
session
protected transient org.eclipse.persistence.internal.sessions.AbstractSession session
-
internalException
protected Throwable internalException
-
shouldPrintInternalException
protected static Boolean shouldPrintInternalException
-
indentationString
protected String indentationString
-
errorCode
protected int errorCode
-
CR
protected static final String CR
-
hasBeenLogged
protected boolean hasBeenLogged
-
-
Constructor Detail
-
EclipseLinkException
protected EclipseLinkException()
INTERNAL: Return a new exception.
-
EclipseLinkException
protected EclipseLinkException(String theMessage)
INTERNAL: EclipseLink exception should only be thrown by EclipseLink.
-
-
Method Detail
-
cr
protected static String cr()
INTERNAL: Convenience method - return a platform-specific line-feed.
-
getErrorCode
public int getErrorCode()
PUBLIC: Return the exception error code.
-
getIndentationString
public String getIndentationString()
INTERNAL: Used to print things nicely in the testing tool.
-
getInternalException
public Throwable getInternalException()
PUBLIC: Return the internal native exception. EclipseLink frequently catches Java exceptions and wraps them in its own exception classes to provide more information. The internal exception can still be accessed if required.
-
getMessage
public String getMessage()
PUBLIC: Return the exception error message. EclipseLink error messages are multi-line so that detail descriptions of the exception are given.- Overrides:
getMessagein classThrowable
-
getSession
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
PUBLIC: Return the session.
-
hasBeenLogged
public boolean hasBeenLogged()
INTERNAL: Return if this exception has been logged to avoid being logged more than once.
-
printStackTrace
public void printStackTrace()
PUBLIC: Print both the normal and internal stack traces.- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintStream outStream)
PUBLIC: Print both the normal and internal stack traces.- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintWriter writer)
PUBLIC: Print both the normal and internal stack traces.- Overrides:
printStackTracein classThrowable
-
setErrorCode
public void setErrorCode(int errorCode)
INTERNAL:
-
setHasBeenLogged
public void setHasBeenLogged(boolean logged)
INTERNAL: Set this flag to avoid logging an exception more than once.
-
setIndentationString
public void setIndentationString(String indentationString)
INTERNAL: Used to print things nicely in the testing tool.
-
setInternalException
public void setInternalException(Throwable exception)
INTERNAL: Used to specify the internal exception.
-
setSession
public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
-
setShouldPrintInternalException
public static void setShouldPrintInternalException(boolean printException)
PUBLIC: Allows overriding of EclipseLink's exception chaining detection.- Parameters:
printException- - If printException is true, the EclipseLink-stored Internal exception will be included in a stack trace or in the exception message of a EclipseLinkException. If printException is false, the EclipseLink-stored Internal Exception will not be included in the stack trace or the exception message of EclipseLinkExceptions
-
shouldPrintInternalException
public static boolean shouldPrintInternalException()
INTERNAL Check to see if the EclipseLink-stored internal exception should be printed in this a EclipseLinkException's stack trace. This method will check the static ShouldPrintInternalException variable and if it is not set, estimate based on the JDK version used.
-
getUnformattedMessage
public String getUnformattedMessage()
INTERNAL:
-
-