Java program using xmltype.getStringVal() generates error java.lang.NullPointerException (Doc ID 1596786.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
JDBC - Version 11.2.0.3.0 and later
Information in this document applies to any platform.

Symptoms

Java program using xmltype.getStringVal() generates error:

java.lang.NullPointerException
  at oracle.xml.binxml.BinXMLDecodeReader.getEventText(BinXMLDecodeReader.java:3986)
  at oracle.xml.binxml.BinXMLDecodeReader.getEventChars(BinXMLDecodeReader.java:3736)
  at oracle.xml.binxml.BinXMLDecodeReader.decode(BinXMLDecodeReader.java:1142)
  at oracle.xml.binxml.BinXMLDecoderImpl.decode(BinXMLDecoderImpl.java:77)
  at oracle.xdb.XMLType.getStringFromBinXMLStream(XMLType.java:4404)
  at oracle.xdb.XMLType.getStringVal(XMLType.java:1592)
  at TestXMLType.test(TestXMLType.java:27)
  at TestXMLType.main(TestXMLType.java:70) ddioid java.sql.SQLException
  at oracle.xdb.XMLType.getStringFromBinXMLStream(XMLType.java:4414)
  at oracle.xdb.XMLType.getStringVal(XMLType.java:1592)
  at TestXMLType.test(TestXMLType.java:27)
  at TestXMLType.main(TestXMLType.java:70)


This combination fails:

JDK6
ojdbc6.jar (From 11.2.0.3.0)
xdb6.jar (From 11.2.0.3.0)
xmlparserv2.jar (From 11.2.0.3.0)

This Works:

JDK6
ojdbc14.jar (10.2.0.4.)
xdb.jar (From 11.2.0.3.0)
xmlparserv2.jar (11.2.0.3.0)

Cause

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