You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dermoritz <ta...@hotmail.com> on 2015/11/10 18:55:09 UTC

rest dsl not working with restlet: "Component restlet is not a RestApiConsumerFactory"

I am trying to use Restlet component with rest dsl but i get "Component
restlet is not a RestApiConsumerFactory"

This route is working fine (camel 2.16):

    public void configure() throws Exception {
       
restConfiguration().component("restlet").apiContextPath("/").port(port);

        from(restEndpoint).process(sendFile);
    }

The rest endpoint is created this way:

RestEndpoint endpoint =
context.getEndpoint("rest:get:next/{"+HEADER_PARAMETER+"}",                                                                                  
org.apache.camel.component.rest.RestEndpoint.class);

The problem with this is that the parameter is not optional. if i surf to
.../next i get 404. So i tried rest dsl:

    public void configure() throws Exception {
       
restConfiguration().component("restlet").apiContextPath("/").port(port);
        rest("/next")
                     .get().to(DIRECT_NEXT)
                    
.get("/{RestEndpointProvider.HEADER_PARAMETER}").to(DIRECT_NEXT);
        from(DIRECT_NEXT).process(sendFile);
    }

but with this i get 
"java.lang.IllegalArgumentException: Component restlet is not a
RestApiConsumerFactory
	at
org.apache.camel.component.rest.RestApiEndpoint.createConsumer(RestApiEndpoint.java:220)
	at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)
	at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:98)
	at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
	at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3440)
	at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3370)
	at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3147)
	at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3003)
	at
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:172)
	at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2799)
	at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2795)
	at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2818)
	at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2795)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
	at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2764)
	at org.apache.camel.main.Main.doStart(Main.java:126)".

Is something wrong with my code or should i have to switch to another
component? (please suggest a component if necessary or explain differences
between them)




--
View this message in context: http://camel.465427.n5.nabble.com/rest-dsl-not-working-with-restlet-Component-restlet-is-not-a-RestApiConsumerFactory-tp5773579.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: rest dsl not working with restlet: "Component restlet is not a RestApiConsumerFactory"

Posted by dermoritz <ta...@hotmail.com>.
i found similar problem:
http://stackoverflow.com/questions/35987688/using-the-camel-jetty-component-with-the-rest-dsl-component-jetty-is-not-a-re

updating (>2.16.1) camel solved this problem 



--
View this message in context: http://camel.465427.n5.nabble.com/rest-dsl-not-working-with-restlet-Component-restlet-is-not-a-RestApiConsumerFactory-tp5773579p5792025.html
Sent from the Camel - Users mailing list archive at Nabble.com.