问题
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