Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-485

Failed to create route fromQueueToLog at: >>> Transacted[ref:null] <<< in route: Route[[From[activemq:acoss]] - ClassCastException - Camel Blueprint

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 2.7.1-fuse-00-27
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When deploying a camel DSL route defined using camel-blueprint, then the following error is generated :

      11:50:29,317 | ERROR | rint Extender: 3 | BlueprintContainerImpl           | ?                                   ? | 10 - org.apache.aries.blueprint - 0.3.1 | Unable to start blueprint container for bundle config-camel.xml
      org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean camel-1
      	at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:638)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:724)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:718)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:499)[84:org.apache.camel.camel-blueprint:2.7.1.fuse-00-27]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:495)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:314)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)[10:org.apache.aries.blueprint:0.3.1]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_24]
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_24]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_24]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_24]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)[:1.6.0_24]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
      	at java.lang.Thread.run(Thread.java:680)[:1.6.0_24]
      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route fromQueueToLog at: >>> Transacted[ref:null] <<< in route: Route[[From[activemq:acoss]] -> [Transacted[ref:null]]] because of java.lang.ClassCastException
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:818)
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
      	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.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.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:78)
      	at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:73)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_24]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_24]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
      	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
      	at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[10:org.apache.aries.blueprint:0.3.1]
      	at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)[10:org.apache.aries.blueprint:0.3.1]
      	... 18 more
      Caused by: org.apache.camel.RuntimeCamelException: java.lang.ClassCastException
      	at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
      	at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:56)
      	at org.apache.camel.impl.DefaultRouteContext.lookup(DefaultRouteContext.java:139)
      	at org.apache.camel.model.TransactedDefinition.doResolvePolicy(TransactedDefinition.java:191)
      	at org.apache.camel.model.TransactedDefinition.resolvePolicy(TransactedDefinition.java:162)
      	at org.apache.camel.model.TransactedDefinition.createProcessor(TransactedDefinition.java:133)
      	at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:433)
      	at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:181)
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:815)
      	... 35 more
      Caused by: java.lang.ClassCastException
      	at java.lang.Class.cast(Class.java:2990)[:1.6.0_24]
      	at org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:43)
      	at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:47)
      	at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:54)
      	... 42 more
       

      To reproduce the error :

      0) Edit the file /etc/org.apache.karaf.features.cfg

      #
      featuresBoot=karaf-framework,config,activemq,camel,camel-blueprint,camel-jms,camel-activemq

      1) Start Fuse ESB 4.4.0-fuse-00-27

      2) Drag and drop the 2 following files in deploy directory

        Gliffy Diagrams

        1. config-activemq.xml
          2 kB
          Charles Moulliard
        2. config-camel.xml
          3 kB
          Charles Moulliard

          Activity

          Hide
          davsclaus Claus Ibsen added a comment -

          We should have better exception when there is class cast exception in lookup. I have created a ticket at Apache to track that
          https://issues.apache.org/jira/browse/CAMEL-4236

          Show
          davsclaus Claus Ibsen added a comment - We should have better exception when there is class cast exception in lookup. I have created a ticket at Apache to track that https://issues.apache.org/jira/browse/CAMEL-4236
          Hide
          davsclaus Claus Ibsen added a comment -

          Does it work if you do not edit the featuresBoot?

          Show
          davsclaus Claus Ibsen added a comment - Does it work if you do not edit the featuresBoot?
          Hide
          cmoulliard Charles Moulliard added a comment -

          @Claus,

          I have cleaned up the boot features to avoid to deploy to much non required bundles. This is not at al related to the issue that we have here.

          Show
          cmoulliard Charles Moulliard added a comment - @Claus, I have cleaned up the boot features to avoid to deploy to much non required bundles. This is not at al related to the issue that we have here.
          Hide
          davsclaus Claus Ibsen added a comment -

          But its osgi, so you never know

          Its just that i want to know if it works "out of the box".

          Show
          davsclaus Claus Ibsen added a comment - But its osgi, so you never know Its just that i want to know if it works "out of the box".
          Hide
          cmoulliard Charles Moulliard added a comment -

          Same error if you deploy all the by default features/bundles provided out of the box in the Fuse ESB release.

          Show
          cmoulliard Charles Moulliard added a comment - Same error if you deploy all the by default features/bundles provided out of the box in the Fuse ESB release.
          Hide
          davsclaus Claus Ibsen added a comment -

          A new Fuse ESB has been released with an updated Fuse MR, that should provide better eror details when the problem as above occurs.

          Can the sample be tested on latest Fuse ESB release?
          I may got a bit time later this week to try it out as well.

          Show
          davsclaus Claus Ibsen added a comment - A new Fuse ESB has been released with an updated Fuse MR, that should provide better eror details when the problem as above occurs. Can the sample be tested on latest Fuse ESB release? I may got a bit time later this week to try it out as well.
          Hide
          davsclaus Claus Ibsen added a comment -

          Still the same problem in fuse 4.4.0-fuse-00-43

          Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route fromQueueToLog at: >>> Transacted[ref:null] <<< in route: Route[[From[activemq:acoss]] -> [Transacted[ref:null]]] because of java.lang.ClassCastException
          at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:818)
          at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
          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.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.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:78)
          at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:73)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_26]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_26]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_26]
          at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_26]
          at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[10:org.apache.aries.blueprint:0.3.1]
          at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[10:org.apache.aries.blueprint:0.3.1]
          at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)[10:org.apache.aries.blueprint:0.3.1]
          ... 18 more
          Caused by: org.apache.camel.RuntimeCamelException: java.lang.ClassCastException
          at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
          at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:56)
          at org.apache.camel.impl.DefaultRouteContext.lookup(DefaultRouteContext.java:139)
          at org.apache.camel.model.TransactedDefinition.doResolvePolicy(TransactedDefinition.java:191)
          at org.apache.camel.model.TransactedDefinition.resolvePolicy(TransactedDefinition.java:162)
          at org.apache.camel.model.TransactedDefinition.createProcessor(TransactedDefinition.java:133)
          at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:433)
          at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:181)
          at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:815)
          ... 35 more
          Caused by: java.lang.ClassCastException
          at java.lang.Class.cast(Class.java:2990)[:1.6.0_26]
          at org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:43)
          at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:47)
          at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:54)
          ... 42 more

          Show
          davsclaus Claus Ibsen added a comment - Still the same problem in fuse 4.4.0-fuse-00-43 Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route fromQueueToLog at: >>> Transacted [ref:null] <<< in route: Route[[From [activemq:acoss] ] -> [Transacted [ref:null] ]] because of java.lang.ClassCastException at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:818) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165) 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.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.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:78) at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26] at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26] at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226) [10:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824) [10:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636) [10:org.apache.aries.blueprint:0.3.1] ... 18 more Caused by: org.apache.camel.RuntimeCamelException: java.lang.ClassCastException at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139) at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:56) at org.apache.camel.impl.DefaultRouteContext.lookup(DefaultRouteContext.java:139) at org.apache.camel.model.TransactedDefinition.doResolvePolicy(TransactedDefinition.java:191) at org.apache.camel.model.TransactedDefinition.resolvePolicy(TransactedDefinition.java:162) at org.apache.camel.model.TransactedDefinition.createProcessor(TransactedDefinition.java:133) at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:433) at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:181) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:815) ... 35 more Caused by: java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) [:1.6.0_26] at org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:43) at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:47) at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:54) ... 42 more
          Hide
          davsclaus Claus Ibsen added a comment -

          This issue may require this ticket to be resolved
          https://issues.apache.org/jira/browse/CAMEL-4347

          Show
          davsclaus Claus Ibsen added a comment - This issue may require this ticket to be resolved https://issues.apache.org/jira/browse/CAMEL-4347
          Hide
          davsclaus Claus Ibsen added a comment -

          For OSGi blueprint, you will have to explicit define a "required" bean and refer to that from <transacted ref="required"/>

           <bean id="required" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
              <property name="transactionManager" ref="jmsTransactionManager"/>
              <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
            </bean>

          Show
          davsclaus Claus Ibsen added a comment - For OSGi blueprint, you will have to explicit define a "required" bean and refer to that from <transacted ref="required"/> < bean id = "required" class = "org.apache.camel.spring.spi.SpringTransactionPolicy" > < property name = "transactionManager" ref = "jmsTransactionManager" /> < property name = "propagationBehaviorName" value = "PROPAGATION_REQUIRED" /> </ bean >

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              cmoulliard Charles Moulliard
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: