Issue with loading TypeConverter in Camel 2.8.2 on JBOSS 7.2
I am new to camel and Jboss, as the camel 2.8 has built in support for jboss, I directly deployed camel spring based web app. I am getting the below exception:
Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: [org.apache.activemq.camel.converter]
at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:116) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:406) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:42) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54) [camel-core-2.8.2.jar:]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:56) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.DefaultCamelContext.startServices(DefaultCamelContext.java:1624) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:903) [camel-core-2.8.2.jar:]
at org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:986) [camel-core-2.8.2.jar:]
FYI: the same war is working as expected with Tomcat.
Re: Issue with loading TypeConverter in Camel 2.8.2 on JBOSS 7.2
The problem is that apparently ActiveMQ seems to make use of the package scan feature of Camel (inside META-INF/org/apache/camel/TypeConverter) instead of specifying the FQN . So it seems to me you've got no other choice other than using JBossPackageScanClassResolver given by .
As an example ActiveMQ (5.5.1) seems to have two converters in that package:
Do you mind to open a JIRA ticket on the ActiveMQ-JIRA to improve this?
And be aware that the JBossPackageScanClassResolver there is built against JBoss 6.x however you seem to need it for JBoss 7.2. So if this approach doesn't work then you should generate the jar by yourself compiled for JBoss 7.2.: