Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1566

java.lang.NullPointerException when validating against WSDL Schema

    XMLWordPrintableJSON

Details

    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))

      { 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              radu_coravu Radu Coravu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 3h
                  3h
                  Remaining:
                  Remaining Estimate - 3h
                  3h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified