XML Data Store Exceptions (13000 - 13020)
XMLDataStoreException
is a run-time exception that is raised when TopLink is used to make objects persistent in the form of XML files (rather than using a relational database.)
Format
EXCEPTION [TOPLINK – error code]: Exception name
EXCEPTION DESCRIPTION: Message
Example 13-12 XML Data Store Exception
EXCEPTION [TOPLINK – 13000]: oracle.toplink.xml.XMLDataStoreException
EXCEPTION DESCRIPTION: File not found: C:\data\myTable\row.xml.
-
13000: FILE_NOT_FOUND
-
Cause: Failed to create a WriteStream
for an XML file (an individual file or a file extracted from a zip archive) because the file could not be found in the file system. This can happen if the XML data accessor is trying to update an XML file and the file does not exist. This indicates an inconsistent state between the application and what is on disk.
-
Action: Verify that the specified file exists.
-
13001: UNABLE_TO_CLOSE_WRITE_STREAM
-
Cause: After writing a row to the XML data store, failed to close the WriteStream
used due to a java.io.IOException
. This can happen if the disk is full.
-
Action: See the generated exception for the root cause. Verify that there is sufficient disk space available for this operation.
-
13002: NOT_A_DIRECTORY
-
Cause: Creating or deleting a file source failed because the file being created or deleted was not a directory or a file exists with the same name as the directory indicated.
-
Action: Verify that TopLink has permissions to create the necessary directories. Verify that there is sufficient disk space available for this operation.
-
13003: DIRECTORY_COULD_NOT_BE_CREATED
-
Cause: Checking or creating a file or document source failed because the mkdir
method of the File failed to create the directory named by the specified abstract path name, including any necessary but nonexistent parent.
-
Action: Verify that TopLink has permission to create the necessary directories. Verify that there is sufficient disk space available for this operation.
-
13004: DIRECTORY_NOT_FOUND
-
Cause: Directory does not exist and TopLink has not been set to create directories as needed (createsDirectoriesAsNeeded
policy is false
.)
-
Action: Either create the appropriate directory or configure TopLink to create directories as needed (set createsDirectoriesAsNeeded
true
).
-
13005: FILE_ALREADY_EXISTS
-
Cause: TopLink is attempting to create a file and the file already exists. TopLink expects to be able to create a new version of the file and will not overwrite an existing file. This can happen if the XML data accessor is trying to insert an XML file and the file already exists. This indicates an inconsistent state between the application and what is on disk.
-
Action: Change where TopLink is writing to, or remove the existing file.
-
13006: UNABLE_TO_CREATE_WRITE_STREAM
-
Cause: Failed to create a WriteStream
due to a java.io.IOException
.
-
Action: See the generated exception for the root cause.
-
13007: INVALID_FIELD_VALUE
-
Cause: Failed to construct an XML element to represent an object because the object was an invalid type. For a direct collection, one or more of the elements had a type that was not null
or a String
. For a nested row, one or more of the elements had a type that was not DatabaseRow
.
-
Action: See the generated exception for the root cause. Verify the configuration of the persistent object to ensure that it can be made persistent in an XML data store.
-
13008: CLASS_NOT_FOUND
-
Cause: Failed to load the specified class due to a java.lang.ClassNotFoundException
. This indicates a problem either with the TopLink JAR file or an improperly configured custom class loader (see the setXMLParserJARFileNames
method of the DatabaseLogin).
-
Action: See the generated exception for the root cause. Confirm that the TopLink JAR file contains the specified class. If you are using a custom class loader, confirm that this class is included in the list of JAR files passed into the setXMLParserJARFileNames
method of the DatabaseLogin.
-
13009: SAX_PARSER_ERROR
-
Cause: Failed to parse the specified XML file due to an org.xml.sax.SAXParseException
.
-
Action: See the generated exception for the root cause including the line and column numbers at which the SAXParseException
was raised.
-
13010: GENERAL_EXCEPTION
-
Cause: An operation failed due to something other than an org.xml.sax.SAXParseException
.
-
Action: An exception was raised when trying either to build a parser or to build a document that caused that action to fail. See the generated exception for the root cause.
-
13011: IOEXCEPTION
-
Cause: A ReadStream
or WriteStream
could not be created due to a java.io.IOException
.
-
Action: See the generated exception for the root cause.
-
13012: UNABLE_TO_CLOSE_READ_STREAM
-
Cause: After reading a row from the XML data store, failed to close the ReadStream
used due to a java.io.IOException
.
-
Action: See the generated exception for the root cause.
-
13013: HETEROGENEOUS_CHILD_ELEMENTS
-
Cause: Composite elements are being stored in a DirectCollectionMapping
. DirectCollectionMappings
in the SDK will work only with simple elements. Simple elements contain only one child of type text in XML.
-
Action: Ensure elements that are mapped as direct collections only contain simple elements.
-
Cause: Child elements of a complex element are not the same type: the type of each child element must be the same as that of the first child element.
-
Action: Verify that the XML document is not corrupt. If it is valid, ensure that it meets SDK requirements as illustrated in
Example 13-13 and
Example 13-14.
-
Cause: Child elements of a complex element do not have the same name.
-
Action: Verify that the XML document is not corrupt. If it is valid, ensure that it meets SDK requirements as in
Example 13-13 and
Example 13-14.
Example 13-13 XML Supported by the SDK
<foo>
<bar> [string or nested elements] </bar>
<bar> [must match the first child: either string or nested elements] </bar>
<bar> [must match the first child: either string or nested elements] </bar>
</foo>
Example 13-14 XML Not Supported by the SDK
<foo>
<bar> ... </bar>
<fred> [this element will cause the exception] </fred>
<bar> ... </bar>
</foo>
-
13017: INSTANTIATION_EXCEPTION
-
Cause: Failed to instantiate the specified class due to a java.lang.InstantiationException
. This indicates a problem either with the TopLink JAR file or an improperly configured custom class loader (see the setXMLParserJARFileNames
method of the DatabaseLogin).
-
Action: See the generated exception for the root cause. Ensure that the specified class is not an interface or an abstract class. Confirm that the TopLink JAR contains the specified class. If you are using a custom class loader, confirm that this class is included in the list of JAR files passed into the setXMLParserJARFileNames
method of the DatabaseLogin.
-
13018: INSTANTIATION_ILLEGAL_ACCESS_EXCEPTION
-
Cause: Failed to instantiate the specified class due to a java.lang.IllegalAccessException
. This indicates a problem either with the TopLink JAR file or an improperly configured custom class loader (see the setXMLParserJARFileNames
method of the DatabaseLogin).
-
Action: See the generated exception for the root cause. Ensure that the specified class is public. Ensure permission is set for Java reflection in your VM security settings. Ensure that the specified class is not an interface or an abstract class. Confirm that the TopLink JAR file contains the specified class. If you are using a custom class loader, confirm that this class is included in the list of JAR files passed into the setXMLParserJARFileNames
method of the DatabaseLogin.
-
13020: ELEMENT_DATA_TYPE_NAME_IS_REQUIRED
-
Cause: Failed to build XML for a given object because the object's data type name is null or zero length.
-
Action: Ensure that the element data type name is provided.