Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-6676

Backport Request: Camel mbean remains even after uninstalling bundle where two routes have same routeId.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • jboss-fuse-6.2.1, jboss-fuse-6.3
    • Camel
    • None
    • % %
    • Hide
      • Unzip the reproducer. Build the project.
      • Deploy in Red Hat JBoss Fuse 6.2.1 with command
        osgi:install -s mvn:com.mycompany/routeId-double/1.0
        
      • Now uninstall the bundle.
      • In Hawtio within camel tab we can find that mbean still exists.
      • However this is fixed in latest camel master branch[1] while in current latest patch[2] Exception clause is only for FailedToCreateRouteException. This bundle fails with FailedToStartRouteException, so this isn't handled thus mbean remains.
      • We would have to backport this change from master branch so that all route related exceptions are handled similar way.

      [1] https://github.com/apache/camel/blob/master/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java#L245
      [2] https://github.com/apache/camel/blob/camel-2.17.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java#L190

      Show
      Unzip the reproducer. Build the project. Deploy in Red Hat JBoss Fuse 6.2.1 with command osgi:install -s mvn:com.mycompany/routeId- double /1.0 Now uninstall the bundle. In Hawtio within camel tab we can find that mbean still exists. However this is fixed in latest camel master branch [1] while in current latest patch [2] Exception clause is only for FailedToCreateRouteException . This bundle fails with FailedToStartRouteException , so this isn't handled thus mbean remains. We would have to backport this change from master branch so that all route related exceptions are handled similar way. [1] https://github.com/apache/camel/blob/master/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java#L245 [2] https://github.com/apache/camel/blob/camel-2.17.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java#L190

      • Logs
        07:35:57,806 | ERROR | l Console Thread | BlueprintCamelContext            | 211 - org.apache.camel.camel-blueprint - 2.15.1.redhat-621177 | Error occurred during starting Camel: CamelContext(camel-1) due Failed to start route timerToLog because of duplicate id detected: timerToLog. Please correct ids to be unique among all your routes.
        org.apache.camel.FailedToStartRouteException: Failed to start route timerToLog because of duplicate id detected: timerToLog. Please correct ids to be unique among all your routes.
        	at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:827)
        	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2897)
        	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2620)
        	at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
        	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2469)
        	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2465)
        	at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2488)
        	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2465)
        	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
        	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2434)
        	at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:184)[211:org.apache.camel.camel-blueprint:2.15.1.redhat-621177]
        	at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:228)[211:org.apache.camel.camel-blueprint:2.15.1.redhat-621177]
        	at org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:154)[211:org.apache.camel.camel-blueprint:2.15.1.redhat-621177]
        	at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)
        	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)
        	at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)
        	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)
        	at org.apache.felix.framework.Felix.registerService(Felix.java:3431)
        	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
        	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353)
        	at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:104)[211:org.apache.camel.camel-blueprint:2.15.1.redhat-621177]
        	at sun.reflect.NativeMethodAcces
        
      • Class BlueprintCamelContext in camel-blueprint bundle.
         @Override
            public void start() throws Exception {
                final ClassLoader original = Thread.currentThread().getContextClassLoader();
                try {
                    // let's set a more suitable TCCL while starting the context
                    Thread.currentThread().setContextClassLoader(getApplicationContextClassLoader());
                    super.start();
                } catch (FailedToCreateRouteException e) {
                    routeDefinitionValid.set(false);
                } finally {
                    Thread.currentThread().setContextClassLoader(original);
                }
            }
        
      • Above catch (FailedToCreateRouteException e) should be replaced with catch(Exception e).

            acosenti Andrea Cosentino
            rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: