XML Containing Diacritics Fails With NullPointerException When Queried Using JDBC Against or Higher Database

(Doc ID 1935312.1)

Last updated on JULY 12, 2017

Applies to:

JDBC - Version and later
Information in this document applies to any platform.


JDBC Thin driver queries fail against data in XMLTYPE columns when that data contains diacritical marks.
This problem did not manifest until the target database was upgraded from to
The problem does not reproduce when using the JDBC OCI driver, nor when using SQL*Plus.

This problem manifests in one of two ways, depending on the version of the JDBC Thin driver being used:

* The JDBC Thin driver fails with a NullPointerException

* The,, and Thin drivers fail with java.sql.SQLException: Invalid character encountered in
  at oracle.sql.CharacterSet.failUTFConversion(CharacterSet.java:2940)
  at oracle.sql.CharacterSetAL32UTF8.toString
  at oracle.xdb.XMLType.processString(XMLType.java:3255)
  at oracle.xdb.XMLType.processThin(XMLType.java:3380)
  at oracle.xdb.XMLType.(XMLType.java:1511)
  at oracle.xdb.XMLType.createXML(XMLType.java:957)
  at oracle.xdb.XMLType.createXML(XMLType.java:931)
  at oracle.jdbc.driver.NamedTypeAccessor$XMLFactory.createXML(NamedTypeAccessor.java:118)
  at oracle.jdbc.driver.NamedTypeAccessor.getOracleObject(NamedTypeAccessor.java:249)
  at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:136)
  at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:110)
  at oracle.jdbc.driver.GeneratedStatement.getObject(GeneratedStatement.java:259)
  at oracle.jdbc.driver.GeneratedScrollableResultSet.getObject(GeneratedScrollableResultSet.java:621)

The problem also reproduces when using the (or 12c) JDBC thin driver against a 12c database.




Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms