I am trying to set up a very simple route to test the camel-olingo2 component. During startup I can verify my Olingo2Component is populated with correct serviceUri and also added to camelContext. Currently I'm testing against a public OData test site and I can verify that the data is there
Here's how the Olingo component is added to camel
@Bean
public Olingo2Component olingo2Component() {
Olingo2Configuration olingo2Configuration = new Olingo2Configuration();
olingo2Configuration.setServiceUri("https://services.odata.org/TripPinRESTierService");
Olingo2Component olingo2Component = new Olingo2Component();
olingo2Component.setConfiguration(olingo2Configuration);
CamelContext camelContext = new DefaultCamelContext();
camelContext.addComponent("olingo2", olingo2Component);
return olingo2Component;
}
My route looks like this
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="test" autoStartup="true">
<from uri="olingo2Component://read/People"/>
<log message="${body}" />
</route>
</routes>
I don't get what properties are missing really. I would expect to receive a json with OData entries of People since I haven't added a query
Any help or hints would be much appreciated
Full stacktrace below
2018-11-21 11:01:46,123 o.s.b.SpringApplication ERROR - Application run failed(858)
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[[From[olingo2Component://read/People]] -> [Log[$... because of Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm]
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:174)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:398)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:355)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at se.tradechannel.suitability.SuitabilityApplication.main(SuitabilityApplication.java:15)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[[From[olingo2Component://read/People]] -> [Log[$... because of Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm]
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:147)
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3949)
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3856)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3642)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3494)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:209)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3253)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3249)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3249)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3165)
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133)
... 14 common frames omitted
Caused by: java.lang.IllegalArgumentException: Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm]
at org.apache.camel.util.component.ApiConsumerHelper.findMethod(ApiConsumerHelper.java:61)
at org.apache.camel.util.component.AbstractApiConsumer.<init>(AbstractApiConsumer.java:52)
at org.apache.camel.component.olingo2.Olingo2Consumer.<init>(Olingo2Consumer.java:37)
at org.apache.camel.component.olingo2.Olingo2Endpoint.createConsumer(Olingo2Endpoint.java:92)
at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69)
at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:107)
at org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:172)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:145)
... 26 common frames omitted
2018-11-21 11:01:46,128 s.t.s.SuitabilityApplication ERROR - org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[[From[olingo2Component://read/People]] -> [Log[$... because of Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm](19)
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[[From[olingo2Component://read/People]] -> [Log[$... because of Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm]
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:174)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:398)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:355)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at se.tradechannel.suitability.SuitabilityApplication.main(SuitabilityApplication.java:15)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[[From[olingo2Component://read/People]] -> [Log[$... because of Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm]
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:147)
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3949)
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3856)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3642)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3494)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:209)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3253)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3249)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3249)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3165)
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133)
... 14 common frames omitted
Caused by: java.lang.IllegalArgumentException: Missing properties for /read, need one or more from [endpointHttpHeaders, responseHandler, queryParams, edm]
at org.apache.camel.util.component.ApiConsumerHelper.findMethod(ApiConsumerHelper.java:61)
at org.apache.camel.util.component.AbstractApiConsumer.<init>(AbstractApiConsumer.java:52)
at org.apache.camel.component.olingo2.Olingo2Consumer.<init>(Olingo2Consumer.java:37)
at org.apache.camel.component.olingo2.Olingo2Endpoint.createConsumer(Olingo2Endpoint.java:92)
at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69)
at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:107)
at org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:172)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:145)
... 26 common frames omitted
I noticed that the edm (entity data model) property is supposed to be added automatically. camel-olingo does an initial call with $metadata to find get the edm. The other properties are supposed to be added automatically too. This doesn't seem to work when you have the initial endpoint as an olingo one. Although the docs say it does.
You could try
That will give you an 'Internal Server Error' exception as https://services.odata.org/TripPinRESTierService uses odata v4.
Change to the camel-olingo4 component to get it to return data.