Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2806

PrettyPrintXMLStreamWriter - method writeStartElement(localname) calls method writeStartElement(prefix, localName, namespaceURI) with wrong paramters

    XMLWordPrintableJSON

Details

    • Novice

    Description

      PrettyPrintXMLStreamWriter

      If you call the method writeStartElement(String localname) it calls writeStartElement(String prefix, String localName, String namespaceURI) with the wrong parameters.
      writeStartElement(String localname, String namespaceURI) is affected as well (namespaceUri and localname are interchanged).

      Instead of writeStartElement(null, localname, null) it calls writeStartElement(null, null, localname). So localname is used as namespaceURI and localname is NULL.

      This leads to an Exception :

      java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
      at javax.xml.namespace.QName.<init>(QName.java:214)
      at javax.xml.namespace.QName.<init>(QName.java:163)
      at org.apache.cxf.wsdl.PrettyPrintXMLStreamWriter.writeStartElement(PrettyPrintXMLStreamWriter.java:231)
      at org.apache.cxf.wsdl.PrettyPrintXMLStreamWriter.writeStartElement(PrettyPrintXMLStreamWriter.java:220)

      Workaround :

      Overwrite writeStartElement(String localname)

      writeStartElement(String localname) {
      writeStartElement(null, localname, null);
      }

      Attachments

        Activity

          People

            gmazza Glen Mazza
            adf Andre Feldmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: