Aries
  1. Aries
  2. ARIES-1005

BundleHookBundleTracker throws Exception when close()-method is called twice

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: util-1.1.1
    • Component/s: Util
    • Labels:
      None

      Description

        public void close() {
            sr.unregister();
            tracked.close();
            tracked = null;
        }
      

      Supsequent calls cause sr.unregister to throw an IllegalStateException.

      Since today, there is a piece of code introduced by ARIES-1004 that does actually do that (http://mail-archives.apache.org/mod_mbox/aries-commits/201301.mbox/%3C20130118083142.DA5852388900%40eris.apache.org%3E)

        Issue Links

          Activity

          Hide
          Christoph Gritschenberger added a comment -

          This can be observed when shutting down karaf [trunk] (with blueprint-core upgraded 1.1.0-SNAPSHOT)

          ERROR: Bundle org.apache.aries.blueprint.core [5] Error stopping bundle. (java.lang.IllegalStateException: Service already unregistered.)
          java.lang.IllegalStateException: Service already unregistered.
          	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:123)
          	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker.close(BundleHookBundleTracker.java:88)
          	at org.apache.aries.util.tracker.RecursiveBundleTracker.close(RecursiveBundleTracker.java:106)
          	at org.apache.aries.blueprint.container.BlueprintExtender.stop(BlueprintExtender.java:160)
          	at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:667)
          	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2361)
          	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1214)
          	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
          	at java.lang.Thread.run(Thread.java:722)
          ERROR: Bundle org.apache.aries.blueprint.core [5] Error stopping mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.1.0-SUP-01 (org.osgi.framework.BundleException: Activator stop error in bundle org.apache.aries.blueprint.core [5].)
          java.lang.IllegalStateException: Service already unregistered.
          	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:123)
          	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker.close(BundleHookBundleTracker.java:88)
          	at org.apache.aries.util.tracker.RecursiveBundleTracker.close(RecursiveBundleTracker.java:106)
          	at org.apache.aries.blueprint.container.BlueprintExtender.stop(BlueprintExtender.java:160)
          	at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:667)
          	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2361)
          	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1214)
          	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
          	at java.lang.Thread.run(Thread.java:722)
          Listening for transport dt_socket at address: 5005
          
          
          Show
          Christoph Gritschenberger added a comment - This can be observed when shutting down karaf [trunk] (with blueprint-core upgraded 1.1.0-SNAPSHOT) ERROR: Bundle org.apache.aries.blueprint.core [5] Error stopping bundle. (java.lang.IllegalStateException: Service already unregistered.) java.lang.IllegalStateException: Service already unregistered. at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:123) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker.close(BundleHookBundleTracker.java:88) at org.apache.aries.util.tracker.RecursiveBundleTracker.close(RecursiveBundleTracker.java:106) at org.apache.aries.blueprint.container.BlueprintExtender.stop(BlueprintExtender.java:160) at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:667) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2361) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1214) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295) at java.lang. Thread .run( Thread .java:722) ERROR: Bundle org.apache.aries.blueprint.core [5] Error stopping mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.1.0-SUP-01 (org.osgi.framework.BundleException: Activator stop error in bundle org.apache.aries.blueprint.core [5].) java.lang.IllegalStateException: Service already unregistered. at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:123) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker.close(BundleHookBundleTracker.java:88) at org.apache.aries.util.tracker.RecursiveBundleTracker.close(RecursiveBundleTracker.java:106) at org.apache.aries.blueprint.container.BlueprintExtender.stop(BlueprintExtender.java:160) at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:667) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2361) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1214) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295) at java.lang. Thread .run( Thread .java:722) Listening for transport dt_socket at address: 5005
          Hide
          Guillaume Nodet added a comment -

          Do you think you can try to provide a patch for that ?

          Show
          Guillaume Nodet added a comment - Do you think you can try to provide a patch for that ?
          Hide
          Christoph Gritschenberger added a comment -

          Sorry, just noticed it's fixed on trunk

          https://svn.apache.org/viewvc?view=revision&revision=1421115

          Show
          Christoph Gritschenberger added a comment - Sorry, just noticed it's fixed on trunk https://svn.apache.org/viewvc?view=revision&revision=1421115
          Hide
          Christoph Gritschenberger added a comment -

          Meaning the real issue is that blueprint-core still uses util-1.0.0

          Show
          Christoph Gritschenberger added a comment - Meaning the real issue is that blueprint-core still uses util-1.0.0
          Hide
          Timothy Ward added a comment -

          Fixed in trunk, will be included in the next util release

          Show
          Timothy Ward added a comment - Fixed in trunk, will be included in the next util release

            People

            • Assignee:
              Unassigned
              Reporter:
              Christoph Gritschenberger
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development