Skip to content

SequenceWriter returns NPE when trying XML serialization #493

@Moribund7

Description

@Moribund7

Describe the bug
SequenceWriter returns NPE when trying XML serialization.

Version information
2.11.2

To Reproduce
If you have a way to reproduce this with:

ByteArrayOutputStream OUTPUT_STREAM = new ByteArrayOutputStream();

  ObjectMapper xmlMapper = new XmlMapper();

  SequenceWriter seqWriter = xmlMapper.writer().writeValues(OUTPUT_STREAM);


  Map<String, String> reportObject = new HashMap<>();
  reportObject.put("a", "b");
  seqWriter.write(reportObject);

Expected behavior

Additional context
Stack trace:

java.lang.NullPointerException
	at com.fasterxml.jackson.dataformat.xml.util.XmlRootNameLookup.findRootName(XmlRootNameLookup.java:41)
	at com.fasterxml.jackson.dataformat.xml.ser.XmlSerializerProvider.serializeValue(XmlSerializerProvider.java:148)
	at com.fasterxml.jackson.databind.SequenceWriter.write(SequenceWriter.java:153)

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