7 Replies Latest reply on Sep 30, 2011 6:11 AM by jamie archibald

    Class cast exception when deploying spring xml

    jamie archibald Apprentice

      I have a simple route which listens on the jetty:http:// endpoint

       

      Exception in thread "SpringOsgiExtenderThread-44" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: F

      ailed to create route httpKmlRequest: Route[[From[jetty:http://0.0.0.0:9999/KmlService/1.0/request... because of Failed to resolve endpoint: jetty://h

      ttp://0.0.0.0:9999/KmlService/1.0/requestKml due to: Cannot auto create component: jetty

              at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)

              at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)

              at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238)

              at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)

              at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)

              at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)

              at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja

      va:358)

              at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication

      Context.java:320)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen

      cyWaiterApplicationContextExecutor.java:132)

              at java.lang.Thread.run(Thread.java:662)

      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route httpKmlRequest: Route[[From[jetty:http://0.0.0.0:9999/KmlService/1.0/

      request... because of Failed to resolve endpoint: jetty://http://0.0.0.0:9999/KmlService/1.0/requestKml due to: Cannot auto create component: jetty

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:170)

              at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:708)

              at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1650)

              at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1439)

              at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1338)

              at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164)

              at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)

              at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)

              at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1316)

              at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)

              at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)

              ... 10 more

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jetty://http://0.0.0.0:9999/KmlService/1.0/requestKml due to:

      Cannot auto create component: jetty

              at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:451)

              at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:47)

              at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:180)

              at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)

              at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)

              at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)

              at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88)

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:796)

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)

              ... 20 more

      Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: jetty

              at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:298)

              at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:428)

              ... 28 more

      Caused by: java.lang.ClassCastException: org.apache.camel.impl.osgi.Activator$BundleComponentResolver cannot be cast to org.apache.camel.spi.Component

      Resolver

              at org.apache.camel.core.osgi.OsgiComponentResolver.getComponent(OsgiComponentResolver.java:71)

              at org.apache.camel.core.osgi.OsgiComponentResolver.resolveComponent(OsgiComponentResolver.java:61)

              at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:289)

              ... 29 more