Top Description Fields Constructors Methods
org.eclipse.persistence.exceptions

public abstract Class EclipseLinkException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.exceptions.EntityManagerSetupException, org.eclipse.persistence.exceptions.JPQLException, org.eclipse.persistence.exceptions.JSONException, org.eclipse.persistence.exceptions.OptimisticLockException, org.eclipse.persistence.exceptions.PersistenceUnitLoadingException, org.eclipse.persistence.exceptions.RemoteCommandManagerException, org.eclipse.persistence.exceptions.SDOException, org.eclipse.persistence.exceptions.ServerPlatformException, org.eclipse.persistence.exceptions.SessionLoaderException, org.eclipse.persistence.exceptions.StaticWeaveException, org.eclipse.persistence.exceptions.TransactionException, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.exceptions.XMLConversionException, org.eclipse.persistence.exceptions.XMLParseException, org.eclipse.persistence.platform.xml.XMLPlatformException, org.eclipse.persistence.exceptions.JAXBException, org.eclipse.persistence.exceptions.BeanValidationException, org.eclipse.persistence.exceptions.CommunicationException, org.eclipse.persistence.exceptions.ConcurrencyException, org.eclipse.persistence.exceptions.ConversionException, org.eclipse.persistence.exceptions.DatabaseException, org.eclipse.persistence.exceptions.DBWSException, org.eclipse.persistence.exceptions.DynamicException
Imports
java.io.PrintStream, .PrintWriter, .StringWriter, org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.internal.sessions.AbstractSession

Purpose: Any exception raised by EclipseLink should be a subclass of this exception class.

Field Summary

Modifier and TypeField and Description
protected static final String
protected int
protected boolean
protected String
protected Throwable
protected transient AbstractSession
protected static Boolean

Constructor Summary

AccessConstructor and Description
protected
EclipseLinkException()

INTERNAL: Return a new exception.

protected
EclipseLinkException(String theMessage)

INTERNAL: EclipseLink exception should only be thrown by EclipseLink.

protected
EclipseLinkException(String message, Throwable internalException)

INTERNAL: EclipseLink exception should only be thrown by EclipseLink.

Method Summary

Modifier and TypeMethod and Description
protected static String
cr()

INTERNAL: Convenience method - return a platform-specific line-feed.

public int
getErrorCode()

PUBLIC: Return the exception error code.

public String
getIndentationString()

INTERNAL: Used to print things nicely in the testing tool.

public Throwable
getInternalException()

PUBLIC: Return the internal native exception.

public String
getMessage()

Overrides java.lang.Throwable.getMessage.

PUBLIC: Return the exception error message.
public AbstractSession
getSession()

PUBLIC: Return the session.

public String
public boolean
hasBeenLogged()

INTERNAL: Return if this exception has been logged to avoid being logged more than once.

public void
printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

PUBLIC: Print both the normal and internal stack traces.
public void
printStackTrace(PrintStream
PrintStream to use for output
outStream
)

Overrides java.lang.Throwable.printStackTrace.

PUBLIC: Print both the normal and internal stack traces.
public void
printStackTrace(PrintWriter
PrintWriter to use for output
writer
)

Overrides java.lang.Throwable.printStackTrace.

PUBLIC: Print both the normal and internal stack traces.
public void
setErrorCode(int errorCode)

INTERNAL:

public void
setHasBeenLogged(boolean logged)

INTERNAL: Set this flag to avoid logging an exception more than once.

public void
setIndentationString(String indentationString)

INTERNAL: Used to print things nicely in the testing tool.

public void
setInternalException(Throwable exception)

INTERNAL: Used to specify the internal exception.

public void
setSession(AbstractSession session)

INTERNAL:

public static void
setShouldPrintInternalException(boolean
- 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
printException
)

PUBLIC: Allows overriding of EclipseLink's exception chaining detection.

public static boolean
shouldPrintInternalException()

INTERNAL Check to see if the EclipseLink-stored internal exception should be printed in this a EclipseLinkException's stack trace.

public String
toString()

Overrides java.lang.Throwable.toString.

INTERNAL:

Field Detail

CRback to summary
protected static final String CR
errorCodeback to summary
protected int errorCode
hasBeenLoggedback to summary
protected boolean hasBeenLogged
indentationStringback to summary
protected String indentationString
internalExceptionback to summary
protected Throwable internalException
sessionback to summary
protected transient AbstractSession session
shouldPrintInternalExceptionback to summary
protected static Boolean shouldPrintInternalException

Constructor Detail

EclipseLinkExceptionback to summary
protected EclipseLinkException()

INTERNAL: Return a new exception.

EclipseLinkExceptionback to summary
protected EclipseLinkException(String theMessage)

INTERNAL: EclipseLink exception should only be thrown by EclipseLink.

EclipseLinkExceptionback to summary
protected EclipseLinkException(String message, Throwable internalException)

INTERNAL: EclipseLink exception should only be thrown by EclipseLink.

Method Detail

crback to summary
protected static String cr()

INTERNAL: Convenience method - return a platform-specific line-feed.

getErrorCodeback to summary
public int getErrorCode()

PUBLIC: Return the exception error code.

getIndentationStringback to summary
public String getIndentationString()

INTERNAL: Used to print things nicely in the testing tool.

getInternalExceptionback to summary
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.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

PUBLIC: Return the exception error message. EclipseLink error messages are multi-line so that detail descriptions of the exception are given.

Returns:String

Doc from java.lang.Throwable.getMessage.

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
getSessionback to summary
public AbstractSession getSession()

PUBLIC: Return the session.

getUnformattedMessageback to summary
public String getUnformattedMessage()

INTERNAL:

hasBeenLoggedback to summary
public boolean hasBeenLogged()

INTERNAL: Return if this exception has been logged to avoid being logged more than once.

printStackTraceback to summary
public void printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

PUBLIC: Print both the normal and internal stack traces.

Annotations
@Override
printStackTraceback to summary
public void printStackTrace(PrintStream outStream)

Overrides java.lang.Throwable.printStackTrace.

PUBLIC: Print both the normal and internal stack traces.

Parameters
outStream:PrintStream

Doc from java.lang.Throwable.printStackTrace.

PrintStream to use for output

Annotations
@Override
printStackTraceback to summary
public void printStackTrace(PrintWriter writer)

Overrides java.lang.Throwable.printStackTrace.

PUBLIC: Print both the normal and internal stack traces.

Parameters
writer:PrintWriter

Doc from java.lang.Throwable.printStackTrace.

PrintWriter to use for output

Annotations
@Override
setErrorCodeback to summary
public void setErrorCode(int errorCode)

INTERNAL:

setHasBeenLoggedback to summary
public void setHasBeenLogged(boolean logged)

INTERNAL: Set this flag to avoid logging an exception more than once.

setIndentationStringback to summary
public void setIndentationString(String indentationString)

INTERNAL: Used to print things nicely in the testing tool.

setInternalExceptionback to summary
public void setInternalException(Throwable exception)

INTERNAL: Used to specify the internal exception.

setSessionback to summary
public void setSession(AbstractSession session)

INTERNAL:

setShouldPrintInternalExceptionback to summary
public static void setShouldPrintInternalException(boolean printException)

PUBLIC: Allows overriding of EclipseLink's exception chaining detection.

Parameters
printException:boolean

- 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

shouldPrintInternalExceptionback to summary
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.

toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

INTERNAL:

Returns:String

Doc from java.lang.Throwable.toString.

a string representation of this throwable.

Annotations
@Override