1
votes

I have an issue when using the Binder implementation in MOXy.
Here is the input XML document (input.xml)

<?xml version="1.0" encoding="utf-8"?>
<root>
  <unmapped />
</root>

And now, here is the source code used to unmarshal XML into a Binder instance and then update the XML from the corresponding Java object:

JAXBContext context = JAXBContext.newInstance(Input.class);

DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();
Document document = builder.parse(new File("input.xml"));

Binder<Node> binder = context.createBinder(Node.class);
Input input = (Input) binder.unmarshal(document);

binder.updateXML(input);  

In the end, the very simple Input class file:

@XmlRootElement(name = "root")
public class Input {
    @XmlAnyElement
    protected Object[] elements;
}  

When the updateXML() method is invoked, the following exception is thrown:

java.lang.NullPointerException
at org.eclipse.persistence.internal.jaxb.DomHandlerConverter.convertObjectValueToDataValue(DomHandlerConverter.java:97)  
1

1 Answers

0
votes

We have been able to confirm this issue and it looks like it will be a very quick fix. You can use the link below to track our progress on this issue.


UPDATE

A fix has been checked into the EclipseLink 2.5.0 stream, a nightly download can be obtained from the following location:

We have also checked in a fix to the EclipseLink 2.4.2 stream. A nightly download can be obtained from the above location starting October 12, 2012.