Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10120

Creating an InputStream from XMLStreamReader fails without default namespace

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.17.2
    • Fix Version/s: 2.17.3, 2.18.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown
    • Regression:
      Regression

      Description

      The XMLStreamReaderInputStream created by the StaxConverter will fail if the document does not define a default namespace, a tag contains an attribute without namespace prefix and the XMLStreamWriter from the JDK is used.

      The error message is:
      javax.xml.stream.XMLStreamException: NamespaceURI cannot be null
      at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamWriterImpl.java:615)
      at org.apache.camel.converter.jaxp.XMLStreamReaderInputStream.ensureBuffering(XMLStreamReaderInputStream.java:106)

      The fix is relatively simple: a check needs to be introduced that replaces null namespaceUris with empty namespace Uris.

      The issue was introduced with CAMEL-10070.

      The issue will not happen with unit tests because those use the woodstox Stax parser.

        Attachments

          Activity

            People

            • Assignee:
              siano Stephan Siano
              Reporter:
              siano Stephan Siano
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: