Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-802

dependent restart causes ComponentNameAlreadyInUseException: Name 'blueprintContainer' is already in use by a registered component



      I saw this problem several months ago. This problem still occurs in the current trunk 0.4.1-snapshot.

      I have two bundles A and B running and A depends on B. In my concrete case, A is an application scenario bundle depending on B the cxf bundle.

      Initially, both are running and have status Active. When I stop B, A goes to status GracePeriod. When I start B again, A is started but does not come back to status Active but goes to status "Failure" with the following error:

      2011-12-14 01:12:49,755 | ERROR | rint Extender: 2 | BlueprintContainerImpl | container.BlueprintContainerImpl
      362 | 10 - org.apache.aries.blueprint - 0.4.1.SNAPSHOT | Unable to start blueprint container for bundle tmp.test-osgi-cxf-provider-bp
      org.apache.aries.blueprint.ComponentNameAlreadyInUseException: Name 'blueprintContainer' is already in use by a registered component
      at org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl.registerComponentDefinition(ComponentDefinitionRegistryImpl.java:88)[10:org.apache.aries.blueprint:0.4.1.SNAPSHOT]
      at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:286)[10:org.apache.aries.blueprint:0.4.1.SNAPSHOT]
      at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:241)[10:org.apache.aries.blueprint:0.4.1.SNAPSHOT]
      at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[10:org.apache.aries.blueprint:0.4.1.SNAPSHOT]
      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:662)[:1.6.0_24]

      The cause of this problem seems to be that this bundle's blueprint container's component definition map is not cleared up prior to getting restarted. This calls ComponentRegistryImpl's registerComponentDefinition and this method checks if the same named component is already in the map.

      I added a line of code to clear up the definition map and this made the bundle start and its status go to Active.

      Please take a look at the attached file.

      Regards, aki


        1. patch.diff
          1 kB
          Akitoshi Yoshida



            • Assignee:
              gnt Guillaume Nodet
              ay Akitoshi Yoshida
            • Votes:
              1 Vote for this issue
              0 Start watching this issue


              • Created: