#251 Illegal Argument Exception

Dozer v5.2.1
closed-fixed
nobody
7
2010-04-07
2010-03-11
rajesh
No

I am try to use dozer for bean copying but getting exception while trying to copy java.util.TreeMap. The treemap contains String values. Both objects are of same bean class so all the properties are same. There is no field mapping as i am copying all the values from one bean to another. Below is the exception trace:

<Error> <org.dozer.MappingProcessor> <BEA-000000> <Field mapping error -->
MapId: null
Type: null
Source parent class: com.xxx.xxx.xxx.vo.XXXVO
Source field name: someMap
Source field type: class java.util.TreeMap
Source field value: {someString=someString someString, someString1=someString1 someString1, someString2=someString2 someString2}
Dest parent class: com.xxx.xxx.xxx.vo.XXXVO
Dest field name: someMap
Dest field type: java.util.TreeMap
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.dozer.util.ReflectionUtils.invoke(ReflectionUtils.java:254)
Truncated. see log file for complete stacktrace

Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.dozer.util.ReflectionUtils.invoke(ReflectionUtils.java:254)
at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.invokeWriteMethod(GetterSetterPropertyDescriptor.java:241)
at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.setPropertyValue(GetterSetterPropertyDescriptor.java:90)
at org.dozer.fieldmap.MapFieldMap.writeDestValue(MapFieldMap.java:83)
at org.dozer.MappingProcessor.writeDestinationValue(MappingProcessor.java:814)
at org.dozer.MappingProcessor.mapFromFieldMap(MappingProcessor.java:306)
at org.dozer.MappingProcessor.mapField(MappingProcessor.java:245)
at org.dozer.MappingProcessor.map(MappingProcessor.java:214)
at org.dozer.MappingProcessor.map(MappingProcessor.java:159)
at org.dozer.MappingProcessor.map(MappingProcessor.java:126)
at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:82)

XML mapping is :

<mapping wildcard="true" map-id="all">
<class-a>com.xxx.xxx.xxx.vo.XXXVO</class-a>
<class-b>com.xxx.xxx.xxx.vo.XXXVO</class-b>
</mapping>

Discussion

  • rajesh

    rajesh - 2010-03-11
    • priority: 5 --> 7
     
  • dmitry (lv)

    dmitry (lv) - 2010-04-07

    bug is fixed. It turned out Map implementation other than HashMap were not supported.

     
  • dmitry (lv)

    dmitry (lv) - 2010-04-07
    • milestone: --> Dozer v5.2.1
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks