Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
2.11.0
-
None
-
None
Description
I'm integrating "Xerces-J 2.11.0-xml-schema-1.1-beta" in Oxygen XML Editor.
After the integration one of our automated tests caught this NPE:
-------------------------------------
java.lang.NullPointerException
at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.getActualValue(Unknown Source)
at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.validate(Unknown Source)
at org.apache.xerces.impl.xs.util.XSTypeHelper.isValueValidForASimpleType(Unknown Source)
at org.apache.xerces.impl.xs.util.XSTypeHelper.isAtomicValueValidForAnUnion(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidatorXerces.addDefaultAttributes(XMLSchemaValidatorXerces.java:3386)
at org.apache.xerces.impl.xs.XMLSchemaValidatorXerces.handleStartElement(XMLSchemaValidatorXerces.java:2376)
at org.apache.xerces.impl.xs.XMLSchemaValidatorXerces.startElement(XMLSchemaValidatorXerces.java:815)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:87)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:268)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1655)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:325)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
--------------------------------------
Basically the XMLSchemaValidator has some code like:
-----------------------
if (attDV.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(),
null,
defaultValue))
}
-------------------------
which sends a "null" value to the content parameter of "isAtomicValueValidForAnUnion" which later generates the NPE.
I will attach a WSDL file (the problem seems to happen when validating any WSDL file) and the "wsdl11soap11.xsd" schema.
Attachments
Issue Links
- duplicates
-
XERCESJ-1488 NullPointerException caused by XMLSchemaValidator.addDefaultAttributes
- Resolved