Skip Headers

# Conversion Exceptions (3001– 3008)

Previous

Next

`ConversionException` is a development exception that is raised when a conversion error occurs by an incompatible type conversion. The message that is returned indicates which type cast caused the exception, as shown in Example: Conversion Exception.

Format

    EXCEPTION [TOPLINK – error code]: Exception name
    EXCEPTION DESCRIPTION: Message
    INTERNAL EXCEPTION: Message

Conversion Exception

    EXCEPTION [TOPLINK – 3006]: oracle.toplink.exceptions.ConversionException
    EXCEPTION DESCRIPTION: object must be of even length to be converted to a ByteArray

3001: COULD_NOT_BE_CONVERTED
  Cause: Attempt to convert an object `object` of class `ObjectClass` to `JavaClass`. The object cannot be converted to a given type.
  Action: Ensure that the object being converted is of the right type.

3002: COULD_NOT_BE_CONVERTED_EXTENDED
  Cause: Attempt to convert an object `object` of class `ObjectClass` from mapping `mappingType` to `JavaClass`. The object cannot be converted to a given type.
  Action: Ensure that the object being converted is of the right type.

3003: INCORRECT_DATE_FORMAT
  Cause: The date in `dateString` is in an incorrect format. The expected format is YYYY-MM-DD.
  Action: Verify the date format.

3004: INCORRECT_TIME_FORMAT
  Cause: The time in `timeString` is in an incorrect format. The expected format is HH:MM:SS.
  Action: Verify the time format.

3005: INCORRECT_TIMESTAMP_FORMAT
  Cause: The timestamp `timestampString` is in an incorrect format. The expected format is YYYY-MM-DD HH:MM:SS.NNNNNNNNN.
  Action: Verify the timestamp format.

3006: COULD_NOT_CONVERT_TO_BYTE_ARRAY
  Cause: Attempt to convert `String` object of uneven length to a `ByteArray`. This object cannot be converted to a `ByteArray`.
  Action: Verify the object being converted.

3007: COULD_NOT_BE_CONVERTED_TO_CLASS
  Cause: Attempt to convert an object `object` of class `ObjectClass` to `JavaClass`. The class `JavaClass` is not on the classpath.
  Action: Ensure that the class `JavaClass` is on the classpath.

3008: INCORRECT_DATE_TIME_FORMAT
  Cause: Incorrect date-time format object. The expected format is YYYY-MM-DD'T'HH:MM:SS.
  Action: Ensure that the date-time object is in the expected format of YYYY-MM-DD'T'HH:MM:SS.

For more information, see the following:

- Schema Manager Java and Database Type Conversion

- Type Conversion Converter