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