Activemq-camel: can not use <to uri=“http://…”>

瘦欲@ 提交于 2019-12-25 19:06:20

问题


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>

Error I get:

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?

EDIT: 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.


回答1:


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.



来源:https://stackoverflow.com/questions/19248596/activemq-camel-can-not-use-to-uri-http

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!