[ 
https://issues.apache.org/jira/browse/CXF-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved CXF-1602.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.7
                   2.1.1
         Assignee: Daniel Kulp


First, there is a problem with the sample:
In the binding.xml, you map both xsd:date and xsd:dateTime to parseDateTime.   
xsd:date should be mapped to just parseDate.


The bug is for "optional" stuff (like the optional date), the null is passed 
into the parseDateTime/printDateTime routines.   We need to just return null 
there as well.   



> DataTypeAdapter causes NPE with jaxb-impl 2.1.6 if multiple bindings go to 
> the same java type
> ---------------------------------------------------------------------------------------------
>
>                 Key: CXF-1602
>                 URL: https://issues.apache.org/jira/browse/CXF-1602
>             Project: CXF
>          Issue Type: Bug
>            Reporter: aaron pieper
>            Assignee: Daniel Kulp
>             Fix For: 2.1.1, 2.0.7
>
>         Attachments: date_bug.zip
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to