Description
A NullPointerException occurs in the attached example. I'm not sure exactly what causes it, but the following conditions seem to play a role:
- jaxb-impl v2.1.6. If we switch to jaxb-impl v2.0.1, the NPE doesn't happen.
- We define a custom binding.xml with two classes mapped to the same java type. In this example, "date" and "datetime" are both mapped to "java.util.Date". If we remove the "datetime" binding, the NPE doesn't happen.
The result is that it tries to pass a "null" value into the Date->String adapter, which causes an NPE.
Caused by: java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1032)
at org.apache.cxf.tools.common.DataTypeAdapter.printDateTime(DataTypeAdapter.java:52)
at gen.jdnets.ds.Adapter2.marshal(Adapter2.java:17)
at gen.jdnets.ds.Adapter2.marshal(Adapter2.java:7)
at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:72)
... 52 more