Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.12.0, 2.14.0
-
None
-
Unknown
Description
I used camel dozer and configured with a mapping.xml for dozer mapping.
Camel fails to do Dozer mapping for the elements mapped with map-id but does not throw any error.
In camel context file define DozerTypeConverterLoader and DozerBeanMapper as follows:
<bean id="dozerConverterLoader"
class="org.apache.camel.converter.dozer.DozerTypeConverterLoader" />
<!-- use bean mapping configuration -->
<bean id="mapper" class="org.dozer.DozerBeanMapper">
<property name="mappingFiles">
<list>
<value>dozer/mapping.xml</value>
</list>
</property>
</bean>
where mapping.xml is the file where the dozer mappings should be defined.
Example:
In camel-context camel will look for the mapping for conversion to PortInNotification as defined in the dozer/mapping.xml
<setBody id="setBodyNPOCIn">
<simple resultType="x.y.NPOCType">${body.getNPOOrNPOCOrNPOR.get(0)}</simple>
</setBody>
<convertBodyTo type="a.b.v1.PortInNotification" id="convertToNPOCPortIn" />
In mapping.xml:
<mapping map-id="mapNPOCtoPortIn">
<class-a>a.b.v1.PortInNotification</class-a>
<class-b>x.y.NPOCType</class-b>
<field>
<a>requestID.id</a>
<b>requestId</b>
</field>
<field>
<a>referenceID.id</a>
<b>referenceId</b>
</field>
</mapping>
Camel-dozer is not able to trace this mapping,however it does not throw any error and simply returns an object of type PortInNotification with null attributes.
On removal of map-id attribute it is able to correctly lookup the mapping of PortInNotification from the mapping.xml
Attachments
Issue Links
- relates to
-
CAMEL-9227 No type converter available to convert from Bean to List
- Resolved