camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexey-s <alex...@mail.ru>
Subject Camel rest DSL and OSGI
Date Mon, 20 Apr 2015 12:30:09 GMT
I had a problem similar to
http://camel.465427.n5.nabble.com/Problem-with-Camel-rest-in-OSGi-td5758649.html

Read Wiki https://cwiki.apache.org/confluence/display/CAMEL/Rest+DSL

The Camel Rest component to use for the REST transport, such as restlet,
spark-rest. If no component has been explicit configured, then Camel will
lookup if there is a Camel component that integrates with the Rest DSL, or
if a org.apache.camel.spi.RestConsumerFactory is registered in the registry.
If either one is found, then that is being used.



I'm add to my karaf features.xml 


After run, see karaf.log

java.lang.IllegalStateException: Cannot find RestConsumerFactory in Registry
or as a Component to use
        at
org.apache.camel.component.rest.RestEndpoint.createConsumer(RestEndpoint.java:313)
        at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
        at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:85)
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
        at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090)

Why the system did not find the component camel-servlet?


Add lines to RouteBuilder.


Error disappears. Test service

karaf.log:

OsgiDefaultCamelContext | 77 - org.apache.camel.camel-core - 2.15.1 | Route:
route-transform started and consuming from:
Endpoint[servlet:///transform/%7Buser%7D/%7Bid%7D/%7Btype%7D?httpMethodRestrict=GET]


wget http://localhost:8181/transform/user/id/type
return HTTP responce: 404 Not Found


---
Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-rest-DSL-and-OSGI-tp5766059.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message