Hi For the rest component you need to use one of the support components for the http transport such as servlet / spark / servlet etc. See the top of this page http://camel.apache.org/rest-dsl
And we ship some examples in the source code, https://github.com/apache/camel/tree/master/examples/camel-example-servlet-rest-tomcat On Thu, Nov 20, 2014 at 11:42 PM, fmontada <fmont...@healthcentrix.com> wrote: > Hi everyone We are using Camel + Spring + Jboss-as > We want to config a REST endpoint using http://camel.apache.org/rest.html > > pom.xml <camelContext id="camelServices" > xmlns="http://camel.apache.org/schema/spring"> > <camel:contextScan/> > </camelContext> > > <bean id="rest" > class="org.apache.camel.component.rest.RestComponent"></bean> > > Route > @Component > public class RouteBuilder extends SpringRouteBuilder{ > > @Override > public void configure() throws Exception { > // TODO Auto-generated method stub > restConfiguration().host("localhost").port(8080); > from("rest:get:hello") > .transform().constant("Bye World"); > } > } > > > but we got the error below > at > org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) > at > org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > [rt.jar:1.7.0_72] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > [rt.jar:1.7.0_72] > at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_72] > > Caused by: java.lang.IllegalStateException: Cannot find RestConsumerFactory > in Registry or as a Component to use > > at > org.apache.camel.component.rest.RestEndpoint.createConsumer(RestEndpoint.java:238) > [camel-core-2.14.0.jar:2.14.0] > at > org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65) > [camel-core-2.14.0.jar:2.14.0] > at > org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80) > [camel-core-2.14.0.jar:2.14.0] > at org.apache.camel.impl.RouteService.warmUp(RouteService.java:134) > [camel-core-2.14.0.jar:2.14.0] > at > org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2379) > [camel-core-2.14.0.jar:2.14.0] > at org.apache.camel. > > some help ? > Best, > Francisco > -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/