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

If we have misconfigured endpoint than mbean is not removed after bundle uninstall.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-7.0
    • jboss-fuse-6.2.1
    • Aries, Camel
    • None
    • % %
    • Hide
      • Extract reproducer 01684771_mbeanNotRemoved.zip. Unzip it. There is a workaround, check description section.
        1. Set uri of endpoint with id "globalscape-clean" to your local path.
        2. If you see currently endpoint for camel's file component is set with wrong option( Note: 'bar=foo' at the end of uri).
        <endpoint id="globalscape-clean" uri="file://home/cpandey/NotBackedUp/Downloads/quart2Poll?recursive=true&amp;filter=#cleanAntFilter&amp;noop=true&amp;initialDelay=1000&amp;delay=5000&amp;bar=foo" />
        

        3. Build using `mvn clean install -DskipTests`.
        4. Deploy this using command

        osgi:install -s mvn:com.mycompany/camelcontext-error/1.0.0-SNAPSHOT
        

        5. We get error in logs, which is obvious as we are using wrong option for file endpoint.

        Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file://home/cpandey/NotBackedUp/Downloads/quart2Poll?bar=foo&delay=5000&filter=%23cleanAntFilter&initialDelay=1000&noop=true&recursive=true due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{bar=foo}]
        

        6. Now uninstall this application.

        uninstall <bundle_id>
        

        7. Now remove "&bar=foo" from uri option of file endpoint. This is now correct configurations. Build the project again using command `mvn clean install -DskipTests`.
        8. Deploy again using command `osgi:install -s mvn:com.mycompany/camelcontext-error/1.0.0-SNAPSHOT`.
        9. It finally results in error:

        10:29:22,830 | WARN  | l Console Thread | BlueprintCamelContext            | 198 - org.apache.camel.camel-core - 2.15.1.redhat-621084 | Lifecycle strategy vetoed starting CamelContext (camelcontext-error123) due CamelContext (camelcontext-error123) with ObjectName[org.apache.camel:context=camelcontext-error123,type=context,name="camelcontext-error123"] is already registered. Make sure to use unique names on CamelContext when using multiple CamelContexts in the same MBeanServer.
        10:29:22,830 | ERROR | l Console Thread | BlueprintCamelContext            | 204 - org.apache.camel.camel-blueprint - 2.15.1.redhat-621084 | Error occurred during starting Camel: CamelContext(camelcontext-error123) due CamelContext (camelcontext-error123) with ObjectName[org.apache.camel:context=camelcontext-error123,type=context,name="camelcontext-error123"] is already registered. Make sure to use unique names on CamelContext when using multiple CamelContexts in the same MBeanServer.
        org.apache.camel.VetoCamelContextStartException: CamelContext (camelcontext-error123) with ObjectName[org.apache.camel:context=camelcontext-error123,type=context,name="camelcontext-error123"] is already registered. Make sure to use unique names on CamelContext when using multiple CamelContexts in the same MBeanServer.
        	at org.apache.camel.management.DefaultManagementLifecycleStrategy.onContextStart(DefaultManagementLifecycleStrategy.java:173)
        	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2552)
        	at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
        	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)
        	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
        
        
      Show
      Extract reproducer 01684771_mbeanNotRemoved.zip. Unzip it. There is a workaround, check description section. 1. Set uri of endpoint with id "globalscape-clean" to your local path. 2. If you see currently endpoint for camel's file component is set with wrong option( Note: 'bar=foo' at the end of uri). <endpoint id= "globalscape-clean" uri= "file: //home/cpandey/NotBackedUp/Downloads/quart2Poll?recursive= true &amp;filter=#cleanAntFilter&amp;noop= true &amp;initialDelay=1000&amp;delay=5000&amp;bar=foo" /> 3. Build using `mvn clean install -DskipTests`. 4. Deploy this using command osgi:install -s mvn:com.mycompany/camelcontext-error/1.0.0-SNAPSHOT 5. We get error in logs, which is obvious as we are using wrong option for file endpoint. Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file: //home/cpandey/NotBackedUp/Downloads/quart2Poll?bar=foo&delay=5000&filter=%23cleanAntFilter&initialDelay=1000&noop= true &recursive= true due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{bar=foo}] 6. Now uninstall this application. uninstall <bundle_id> 7. Now remove "&bar=foo" from uri option of file endpoint. This is now correct configurations. Build the project again using command `mvn clean install -DskipTests`. 8. Deploy again using command `osgi:install -s mvn:com.mycompany/camelcontext-error/1.0.0-SNAPSHOT`. 9. It finally results in error: 10:29:22,830 | WARN | l Console Thread | BlueprintCamelContext | 198 - org.apache.camel.camel-core - 2.15.1.redhat-621084 | Lifecycle strategy vetoed starting CamelContext (camelcontext-error123) due CamelContext (camelcontext-error123) with ObjectName[org.apache.camel:context=camelcontext-error123,type=context,name= "camelcontext-error123" ] is already registered. Make sure to use unique names on CamelContext when using multiple CamelContexts in the same MBeanServer. 10:29:22,830 | ERROR | l Console Thread | BlueprintCamelContext | 204 - org.apache.camel.camel-blueprint - 2.15.1.redhat-621084 | Error occurred during starting Camel: CamelContext(camelcontext-error123) due CamelContext (camelcontext-error123) with ObjectName[org.apache.camel:context=camelcontext-error123,type=context,name= "camelcontext-error123" ] is already registered. Make sure to use unique names on CamelContext when using multiple CamelContexts in the same MBeanServer. org.apache.camel.VetoCamelContextStartException: CamelContext (camelcontext-error123) with ObjectName[org.apache.camel:context=camelcontext-error123,type=context,name= "camelcontext-error123" ] is already registered. Make sure to use unique names on CamelContext when using multiple CamelContexts in the same MBeanServer. at org.apache.camel.management.DefaultManagementLifecycleStrategy.onContextStart(DefaultManagementLifecycleStrategy.java:173) at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2552) at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167) at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467) at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
    • 7.0 Sprint 1

    Description

      Workaround:
      If we move cxfEndpoint above the camel-context, than we don't see this issue, mbean is removed after uninstalling the bundle. But problem arise when we have multiple blueprint xmls. Problem with multiple blueprint files can also be resolved if we rename them in alphabetical order(a--z) and blueprint file with cxfEndpoint is renamed so that it loads earlier than we don't get this issue.

      Problem is we don't have any other usecase where we need to reorder the sequence of cxfEndpoint and camel-context, this seems to be special. Neither we reorder blueprint files.

      Attachments

        Issue Links

          Activity

            People

              pantinor@redhat.com Paolo Antinori
              rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
              Jan Bouska Jan Bouska
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: