Activemq-camel:不能使用<to uri="http://..."> [英] Activemq-camel: can not use <to uri="http://...">

查看:28
本文介绍了Activemq-camel:不能使用<to uri="http://...">的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想帮助解决这个问题,bean.xml 中的以下代码给了我错误

I want help to solve this problem, the following code is in bean.xml gives me error

<camelContext id="activeContext1" xmlns="http://camel.apache.org/schema/spring">

    <route>
        <from uri="activemq:queue:ThermalMap"/>
        <to uri="http://myhost:8161/Example?throwExceptionOnFailure=false"/>
    </route>
</camelContext>

我得到的错误:

org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: 无法在以下位置创建路由 route1: >>> To[http://myhost:8161/Example?throwExceptionOnFailure=false] <<<在路由中:Route[[From[activemq:queue:ThermalMap]] -> [To[htt://myhost... 因为无法解析端点:htt://myhost:8161/Example?throwExceptionOnFailure=false 由于:无法自动创建组件:http

org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[http://myhost:8161/Example?throwExceptionOnFailure=false] <<< in route: Route[[From[activemq:queue:ThermalMap]] -> [To[htt://myhost... because of Failed to resolve endpoint: htt://myhost:8161/Example?throwExceptionOnFailure=false due to: Cannot auto create component: http

我该如何解决这个问题?

How can I solve this problem?

我在 Eclipse 中编辑我的应用程序.我已经在 webcontent/WEB-INF/lib 文件夹中手动添加了所有 jar 文件.Bean.xml 是定义我的应用程序的那个.我使用 java 来编写我的 consumer()processor() 函数.

I edit my application in eclipse. I have manually added all jar files in webcontent/WEB-INF/lib folder. Bean.xml is the one define my application. I used java to write my consumer() and processor() functions.

推荐答案

也许你还没有放置 camel-http 类路径中的组件.如果您使用的是 maven,那么将camel-http 组件的依赖项放在您的pom 中,它应该可以工作.

Perhaps you have not placed camel-http component in classpath. If you are using maven then put the dependency of camel-http component in your pom and it shall work.

这篇关于Activemq-camel:不能使用&lt;to uri="http://..."&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆