Hello, You have camel-core and camel-spring version 2.10 mixed up with camel-cxf version 2.12. The class definitions are different, that's why they can't find each other.
Try upgrading camel-core and camel-spring to 2.12. Regards, *Raúl Kripalani* Apache Camel PMC Member & Committer | Enterprise Architect, Open Source Integration specialist http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Wed, Feb 19, 2014 at 9:26 AM, amilabanuka <[email protected]> wrote: > I\m creating a project wich exposes rest web service. > > here is my camel route > <camel:camelContext xmlns="http://camel.apache.org/schema/spring"> > > <camel:route> > <from uri="cxfrs:bean:restServer"/> > <log message="**************************** Request Hits ....... > Body : ${body} **************************" /> > <to uri="bean:service"/> > <log message="**************************** Response Simulated > ....... Body : ${body} **************************" /> > <to uri="bean:responseTransformer"/> > <log message="**************************** Response Transformed > ....... Body : ${body} **************************" /> > </camel:route> > </camel:camelContext> > > and the cxf end point is as follows > <cxf:rsServer id="restServer" > address="http://localhost:8080/sims/control" > serviceClass="<Class_name>" > loggingFeatureEnabled="true"> > > <cxf:providers> > <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" /> > </cxf:providers> > > </cxf:rsServer> > > > when installing in karaf following exception is thrown > > karaf@root> Exception in thread "SpringOsgiExtenderThread-6" > org.apache.camel.RuntimeCamelException: > org.apache.camel.FailedToCreateRouteException: Failed to create route > route3: Route[[From[cxfrs:bean:restServer]] -> [Log[****************... > because of Failed to resolve endpoint: cxfrs://bean:restServer due to: > Cannot auto create component: cxfrs > at > > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1280) > at > > org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120) > at > > org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:280) > at > > org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96) > at > > org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) > at > > org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948) > at > > org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235) > at > > org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358) > at > > org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) > at > > org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) > at > > org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) > at java.lang.Thread.run(Thread.java:662) > Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create > route route3: Route[[From[cxfrs:bean:restServer]] -> > [Log[****************... because of Failed to resolve endpoint: > cxfrs://bean:restServer due to: Cannot auto create component: cxfrs > at > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:176) > at > > org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:712) > at > > org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1749) > at > > org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1542) > at > > org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1427) > at > > org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179) > at > org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60) > at > > org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1395) > at > > org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228) > at > > org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118) > ... 10 more > Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to > resolve endpoint: cxfrs://bean:restServer due to: Cannot auto create > component: cxfrs > at > > org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:469) > at > > org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50) > at > > org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:186) > at > > org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107) > at > > org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113) > at > > org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72) > at > > org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89) > at > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:851) > at > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:171) > ... 19 more > Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create > component: cxfrs > at > > org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:319) > at > > org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:446) > ... 27 more > Caused by: java.lang.ClassCastException: > org.apache.camel.impl.osgi.Activator$BundleComponentResolver cannot be cast > to org.apache.camel.spi.ComponentResolver > at > > org.apache.camel.core.osgi.OsgiComponentResolver.getComponent(OsgiComponentResolver.java:72) > at > > org.apache.camel.core.osgi.OsgiComponentResolver.resolveComponent(OsgiComponentResolver.java:64) > at > > org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:308) > ... 28 more > > > > I checked the camel version and cxf version > > karaf@root> osgi:list |grep camel > [ 82] [Active ] [ ] [ ] [ 50] camel-core (2.12.0) > [ 83] [Active ] [Created ] [ ] [ 50] camel-karaf-commands > (2.12.0) > [ 97] [Active ] [ ] [ ] [ 50] camel-spring (2.12.0) > [ 98] [Active ] [Created ] [ ] [ 50] camel-blueprint > (2.12.0) > [ 159] [Active ] [Created ] [ ] [ 50] camel-cxf-transport > (2.12.0) > [ 160] [Active ] [Created ] [ ] [ 50] camel-cxf (2.12.0) > [ 169] [Active ] [ ] [ ] [ 50] camel-core (2.10.0) > [ 170] [Active ] [Created ] [ ] [ 50] camel-karaf-commands > (2.10.0) > [ 171] [Active ] [ ] [ ] [ 50] camel-spring (2.10.0) > [ 172] [Active ] [Created ] [ ] [ 50] camel-blueprint > (2.10.0) > > karaf@root> osgi:list |grep cxf > [ 159] [Active ] [Created ] [ ] [ 50] camel-cxf-transport > (2.12.0) > [ 160] [Active ] [Created ] [ ] [ 50] camel-cxf (2.12.0) > karaf@root> > > > A help will be very much appriciated here > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Unable-to-resolve-endpoint-for-cxf-rest-service-tp5747533.html > Sent from the Camel - Users mailing list archive at Nabble.com. >
