You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "MADHUMITA (JIRA)" <ji...@apache.org> on 2015/10/11 11:21:05 UTC

[jira] [Updated] (CAMEL-9178) Apache Camel is not able to read map-id in Dozer mapping xml but does not throw any error

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

MADHUMITA updated CAMEL-9178:
-----------------------------
    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

  was:
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.


> Apache Camel is not able to read map-id in Dozer mapping xml but does not throw any error
> -----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-9178
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9178
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-dozer
>    Affects Versions: 2.12.0, 2.14.0
>            Reporter: MADHUMITA
>            Priority: Minor
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)