Fix field mapping error in dozer config
ekala opened this issue · comments
Emmanuel Kala commented
The image.url
source field in com.ushahidi.swiftriver.core.model.Drop
is of type java.lang.String
but the the destination field - image
- in com.ushahidi.swiftriver.core.api.dto.GetDropDTO
is of type com.ushahidi.swiftriver.core.api.dto.GetDropDTO.GetMediaDTO
This causes the Dozer bean mapper to throw an org.dozer.MappingException
. See the trace below for context:
17:40:16.864 [http-8080-1] ERROR org.dozer.MappingProcessor - Field mapping error -->
MapId: null
Type: null
Source parent class: com.ushahidi.swiftriver.core.model.Drop
Source field name: image.url
Source field type: class java.lang.String
Source field value: http://i.i.com.com/cnwk.1d/i/tim/2012/09/06/iphone5rumors9612_610x345.jpg
Dest parent class: com.ushahidi.swiftriver.core.api.dto.GetDropDTO
Dest field name: image
Dest field type: com.ushahidi.swiftriver.core.api.dto.GetDropDTO$GetMediaDTO
org.dozer.MappingException: Illegal object type for the method 'setImage'.
Expected types:
com.ushahidi.swiftriver.core.api.dto.GetDropDTO$GetMediaDTO
Actual types:
java.lang.String