Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: 2.17.2
-
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.