#206 MappingException for XMLGregorianCalendar

Dozer v5.2
closed-fixed
5
2009-10-22
2009-07-24
Matthias Stetter
No

The Field "auftragskundenwunschtermin" is defined as javax.xml.datatype.XMLGregorianCalendar in both classes. Why do I get the mapping exception and how can I fix it?

Source parent class: xxx.TechnischesDeltaType
Source field name: auftragskundenwunschtermin
Source field type: class org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl
Source field value: 2009-07-21
Dest parent class: yyy.TechnischesDeltaType
Dest field name: auftragskundenwunschtermin
Dest field type: javax.xml.datatype.XMLGregorianCalendar
org.dozer.MappingException: java.lang.InstantiationException
at org.dozer.util.MappingUtils.throwMappingException(MappingUtils.java:88)
at org.dozer.factory.DestBeanCreator.newInstance(DestBeanCreator.java:175)
at org.dozer.factory.DestBeanCreator.create(DestBeanCreator.java:97)
at org.dozer.MappingProcessor.mapCustomObject(MappingProcessor.java:436)
at org.dozer.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:406)
at org.dozer.MappingProcessor.mapFromFieldMap(MappingProcessor.java:300)
at org.dozer.MappingProcessor.mapField(MappingProcessor.java:246)
at org.dozer.MappingProcessor.map(MappingProcessor.java:215)
at org.dozer.MappingProcessor.map(MappingProcessor.java:160)
at org.dozer.MappingProcessor.map(MappingProcessor.java:118)
at org.dozer.MappingProcessor.map(MappingProcessor.java:113)
at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:94)
...

Matthias Stetter

Discussion

  • Patch added: 2880901

    It seems that is not a bug. You must set
    <b-hint>com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl</b-hint>

    for the dest field

     
  • dmitry (lv)
    dmitry (lv)
    2009-10-22

    • milestone: 888640 --> Dozer v5.2
    • assigned_to: nobody --> vadeg
    • status: open --> closed-fixed
     
  • dmitry (lv)
    dmitry (lv)
    2009-10-22

    Fixed in 5.2