Java Apache Camel:DefaultMessage无法强制转换为JmsMessage

Java Apache Camel:DefaultMessage无法强制转换为JmsMessage,java,jms,apache-camel,Java,Jms,Apache Camel,我正试图使用驼峰路由,在新JMS消息到达给定队列时,向PHP脚本发送POST消息。我已经开始工作了,但是现在POST消息缺少JMS消息体,我在ActiveMQ日志中发现以下错误: 2011-10-10 17:46:39,961 | ERROR | Caused by: [org.apache.camel.RuntimeCamelException - java.lang.ClassCastException: org.apache.camel.impl.DefaultMessage cannot

我正试图使用驼峰路由,在新JMS消息到达给定队列时,向PHP脚本发送POST消息。我已经开始工作了,但是现在POST消息缺少JMS消息体,我在ActiveMQ日志中发现以下错误:

2011-10-10 17:46:39,961 | 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
我已经在pom.xml文件中包含了camel jms依赖项。我正在使用Camel 2.4.0,并将Camel jms jar文件放在ActiveMQ的lib文件夹中

这就是我的路线目前的样子:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route autoStartup="true" inheritErrorHandler="true" id="route2" xmlns:ns2="http://camel.apache.org/schema/web" xmlns="http://camel.apache.org/schema/spring">
    <from uri="activemq:topic:topic_name"/>
    <setBody inheritErrorHandler="true" id="setBody2">
        <simple>name=${body}</simple>
    </setBody>
    <setHeader headerName="Content-Type" inheritErrorHandler="true" id="setHeader3">
        <constant>application/x-www-form-urlencoded;</constant>
    </setHeader>
    <setHeader headerName="CamelHttpMethod" inheritErrorHandler="true" id="setHeader4">
        <constant>POST</constant>
    </setHeader>
    <to uri="http://path/to/process.php" inheritErrorHandler="true" id="to2"/>
</route>

名称=${body}
application/x-www-form-urlencoded;
邮递

我的路线配置中是否缺少某些内容?或者ActiveMQ服务器本身有问题吗?

Camel中有一个错误。您可以通过升级Camel或使用更新的AMQ来修复此问题,AMQ有更新的Camel版本。

Camel中有一个错误。您可以通过升级Camel或使用更新的AMQ来解决此问题,AMQ具有更新的Camel版本。

运行此Camel路由的应用程序的lib目录中是否也存在Camel jms依赖项?这才是它真正需要的地方。运行这个驼峰路由的应用程序的lib目录中的驼峰jms依赖项也是吗?这才是真正需要的。