Skip to content

Use of non-Stax2-compatible Stax2 implementation fails when reading from byte[] #482

@cowtowncoder

Description

@cowtowncoder

(note: inspired by #481)

Looks like there is one error mode when using JDK-bundled Stax implementation -- or more generally, anything that does not implement Stax2 extensions. Exception when reading from byte[] looks something like this:

java.lang.UnsupportedOperationException: Cannot create XMLStreamReader or XMLEventReader from a org.codehaus.stax2.io.Stax2ByteArraySource
	at com.sun.xml.stream.ZephyrParserFactory.jaxpSourcetoXMLInputSource(ZephyrParserFactory.java:304)
	at com.sun.xml.stream.ZephyrParserFactory.createXMLStreamReader(ZephyrParserFactory.java:151)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:631)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:1)
	at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:1122)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3636)	

It should be relatively easy to work around the issue, to provide input source non-Stax2 implementations can use instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions