camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-9178) Apache Camel is not able to read map-id in Dozer mapping xml but does not throw any error
Date Tue, 13 Oct 2015 06:03:05 GMT

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

Claus Ibsen resolved CAMEL-9178.
--------------------------------
       Resolution: Fixed
         Assignee: Claus Ibsen
    Fix Version/s: 2.16.1
                   2.17.0
                   2.15.4

Thanks the type converted needed to lookup the map-id and provide as parameter to dozer. As
dozer was not able to do this by itself.

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.15.4, 2.17.0, 2.16.1
>
>
> 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)

Mime
View raw message