Radu Coravu created XERCESJ-1566:
------------------------------------

             Summary: java.lang.NullPointerException when validating against 
WSDL Schema
                 Key: XERCESJ-1566
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1566
             Project: Xerces2-J
          Issue Type: Bug
    Affects Versions: 2.11.0
            Reporter: Radu Coravu


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)) {
                            fisAtomicValueValid = false; 
                        }
                    }
-------------------------

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.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to