Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
377 views
in Technique[技术] by (71.8m points)

Activemq-camel: can not use <to uri="http://...">

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...