Details
Description
From the JiBX FAQ:
Q. Why do I get a java.lang.NullPointerException when I try to
marshal a document?
A. The most likely cause is that you've got a null value for an
object that's not marked as optional in the binding definition.
... snip ...
add a pre-get method to that class for debugging purposes
... snip ...
It occurs to me that it's relatively simple to change that NPE to a jibx exception that identifies that "name" value that was passed into MarshallingContext.element with a null value so that the user doesn't have to modify his bindings file just to figure out which item was null (which isn't always possible, especially when it happens in production).
I've already applied this patch to beta3c (which we're using here); I'll attach the same patch to this issue.
The attached file was generated with "diff -u", and has been tested with the command:
patch -p0 < MarshallingContext.diff
relative to the "jibx" directory of a freshly unzipped version of jibx-beta3c.zip.