camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shiv <shiv.dixit....@gmail.com>
Subject Multiple DB inserts due to org.apache.camel.impl.DefaultMessage cannot be cast to org.apache.camel.component.jms.JmsMessage exception while using local JMS transaction
Date Fri, 09 May 2014 10:11:38 GMT
Hi,
I am using Camel 2.2.0 (pretty old version but present in a legacy
application) and my route reads data from a JMS queue and persists in DB
using JDBC component. I am getting below error in log:

2014-05-09 15:12:16,416 | ERROR | Caused by:
[org.apache.camel.RuntimeCamelException - java.lang.ClassCastException:
org.apache.camel.impl.DefaultMessage cannot be cast to
org.apache.camel.component.jms.JmsMessage] |
org.apache.camel.component.jms.EndpointMessageListener |
DefaultMessageListenerContainer-1
org.apache.camel.RuntimeCamelException: java.lang.ClassCastException:
org.apache.camel.impl.DefaultMessage cannot be cast to
org.apache.camel.component.jms.JmsMessage
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)

As per old posts on this forum, this issue is fixed in higher Camel
versions. But this is not causing more issues to me other than filling up
the logs, if a message comes to queue, one record is inserted in DB.

But I am now using local JMS transaction and this exception is creating
issues. For each JMS message, I see 7 ERROR messages in log and 7 similar
records are getting inserted in DB. Without local JMS transaction, it works
fine.

Apart from upgrading to higher Camel version, anybody has faced this issue
and figured the solution? All inputs are welcome.

Thanks
Shiv



--
View this message in context: http://camel.465427.n5.nabble.com/Multiple-DB-inserts-due-to-org-apache-camel-impl-DefaultMessage-cannot-be-cast-to-org-apache-camel-cn-tp5750959.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message