I am trying to use dozer custom mapping in Karaf.
I am using: Karaf 2.2.5, spring 3.0.6.RELEASE, spring-dm 1.2.1, dozer 5.3.1.
I declare the custom mapping file in spring as following :
/ <bean id="dozerConverterLoader"
class="org.apache.camel.converter.dozer.DozerTypeConverterLoader" />
<bean id="mapper" class="org.dozer.DozerBeanMapper" lazy-init="true">
<property name="mappingFiles">
<list>
<value>vo_mapping.xml</value>
</list>
</property>
</bean>/
When I deploy the bundle in karaf it works fine, the problem comes after
karaf start up. On first execution I got this error :
2012-06-27 18:19:07,583
ERROR
477983&brandId=3
- 2.8.2
Failed delivery for exchangeId:
ID-u-server-4-guest-6-54973-1340792281569-4-19. Exhausted after delivery
attempt: 1 caught: org.apache.camel.InvalidPayloadException: No body
available of type: com.mycompany.MyClass but has value:
com.mycompany.MyOtherClass@728fbbb4 of type:
com.mycompany.MyOtherClass on: Message:
com.mycompany.MyOtherClass@728fbbb4. Caused by: No type converter available
to convert from type: com.mycompany.MyOtherClass to the required type:
It doesn't find the custom mapping file (vo_mapping.xml). I need to manually
refresh the bundle, and then the file is loaded normally.
I thought of a start-level problem but everything seems fine:
spring-osgi-core is at 30, dozer-osgi is at 50, and my bundle is at 80.
Would you have any idea that could explain this behavior?
Also It seems I can't define a file: path to get the xml file, I got a Null
Pointer Exception. But I suppose this is a question for dozer ML.
(For example <property name="mappingFiles">
<list>
<value>file:home/myHome/apapche-karaf-2.2.5/etc/vo_mapping.xml</value>
</list>
throws a exception).
Thanks,
Regards,
Gabriel D'Halluin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to use dozer custom mapping in Karaf.
I am using: Karaf 2.2.5, spring 3.0.6.RELEASE, spring-dm 1.2.1, dozer 5.3.1.
I declare the custom mapping file in spring as following :
/ <bean id="dozerConverterLoader"
class="org.apache.camel.converter.dozer.DozerTypeConverterLoader" />
<bean id="mapper" class="org.dozer.DozerBeanMapper" lazy-init="true">
<property name="mappingFiles">
<list>
<value>vo_mapping.xml</value>
</list>
</property>
</bean>/
When I deploy the bundle in karaf it works fine, the problem comes after
karaf start up. On first execution I got this error :
It doesn't find the custom mapping file (vo_mapping.xml). I need to manually
refresh the bundle, and then the file is loaded normally.
I thought of a start-level problem but everything seems fine:
spring-osgi-core is at 30, dozer-osgi is at 50, and my bundle is at 80.
Would you have any idea that could explain this behavior?
Also It seems I can't define a file: path to get the xml file, I got a Null
Pointer Exception. But I suppose this is a question for dozer ML.
(For example <property name="mappingFiles">
<list>
<value>file:home/myHome/apapche-karaf-2.2.5/etc/vo_mapping.xml</value>
</list>
throws a exception).
Thanks,
Regards,
Gabriel D'Halluin
Did You get Solution to this error..?