You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "ambarish.d" <d....@gmail.com> on 2012/07/03 18:05:50 UTC

Failed to load type converters

I created a Camel based JMS Utility jar which will be embeded inside WAR file
of Tomcat web project.
My corporate infrastructure uses IBM MQ and ActiveMQ and both supporting
jars are in Tomcat/lib and there is strict policy that application should
not use these Jars within there app/lib.

Now, I am adding my utility jars and camel jars (mentioned the list below)
in app/lib but I am getting :
"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]"

I have included following Jars:

camel-core-2.9.0.jar
camel-jms-2.9.0.jar
slf4j and spring jars.

Any help will be really appriciated. thanks in advance.
Below is the Exception snapshot:

ERROR (com.XXXX.ta.ca.jmf.ComsumerStarterServlet) Exception Loading consumer
class ::com.XXXX.eai.msgtest.consumers.AMQViertualTopicConsumer
org.apache.camel.RuntimeCamelException:
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.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1196)
	at
org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1019)
	at
org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:1034)
	at
org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:2003)
	at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1481)
	at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1391)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
	at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1359)
	at com.XXXX.ta.ca.jmf.context.MAOContext.init(MAOContext.java:93)
	at com.XXXX.ta.ca.jmf.context.MAOContext.<init>(MAOContext.java:65)
	at com.XXXX.ta.ca.jmf.context.MAOContext.getInstance(MAOContext.java:79)
	at
com.XXXX.ta.ca.jmf.ComsumerStarterServlet.startConsumer(ComsumerStarterServlet.java:189)
	at
com.XXXX.ta.ca.jmf.ComsumerStarterServlet.init(ComsumerStarterServlet.java:175)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
	at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
	at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
	at
com.XXXX.is.dt.server.tomcat.util.TomcatUpdater.main(TomcatUpdater.java:71)


-----
thanks
Amby
--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-tp5715415.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Failed to load type converters

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yes you need to use AMQ 5.6.0 which is compatible with Camel 2.9.x onwards.

If using older AMQ releases you would need to patch the JAR yourself,
eg as Babak has shown below, its fairly simple as you would need to
patch the TypeConverter file in the META-INF dir.

Another alternative is to downgrade Camel. I think either you would
have to go down to 2.8 or 2.7 releases, which was not as strict in
case of failed type converter loading during startup.


On Tue, Jul 3, 2012 at 7:50 PM, Babak Vahdat
<ba...@swissonline.ch> wrote:
> The problem is the AMQ version you make use of, that's the content of this
> file:
>
> https://svn.apache.org/repos/asf/activemq/tags/activemq-5.4.2/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
>
> Which in 5.6.0 makes use of FQN:
>
> https://svn.apache.org/repos/asf/activemq/tags/activemq-5.6.0/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
>
> I'm not aware of any other workaround other than upgrading to AMQ 5.6.0.
> However others in the forum may know about other possible options.
>
> Babak
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-tp5715415p5715419.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Failed to load type converters

Posted by Babak Vahdat <ba...@swissonline.ch>.
The problem is the AMQ version you make use of, that's the content of this
file:

https://svn.apache.org/repos/asf/activemq/tags/activemq-5.4.2/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/TypeConverter

Which in 5.6.0 makes use of FQN:

https://svn.apache.org/repos/asf/activemq/tags/activemq-5.6.0/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/TypeConverter

I'm not aware of any other workaround other than upgrading to AMQ 5.6.0.
However others in the forum may know about other possible options.

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-tp5715415p5715419.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Failed to load type converters

Posted by "ambarish.d" <d....@gmail.com>.
Babak,

Thanks but I am already using camel 2.9.0.
For ActiveMQ I am on 5.4.2 and out of scope for me to upgrade provider
version.

Is there any workaround available for this issue.



-----
thanks
Amby
--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-tp5715415p5715418.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Failed to load type converters

Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi

your question has been answered here:

http://camel.465427.n5.nabble.com/TypeConverterLoaderException-with-ActiveMQ-route-in-OSGi-td5456103.html

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-tp5715415p5715417.html
Sent from the Camel - Users mailing list archive at Nabble.com.