Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9139

URLHandler unregistered too often

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Installer Core 3.10.0
    • Fix Version/s: Installer Core 3.10.2
    • Component/s: Installer
    • Labels:
      None

      Description

      The following error message can be observed in the log when stopping the instance

      24.02.2020 20:19:44.233 *ERROR* [FelixStartLevel] ERROR: Bundle '19' Error stopping bundle. (java.lang.IllegalStateException: Service already unregistered.)
      java.lang.IllegalStateException: Service already unregistered.
      	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:141)
      	at org.apache.sling.installer.core.impl.UpdateHandlerTracker.updateUrlStreamHandler(UpdateHandlerTracker.java:90)
      	at org.apache.sling.installer.core.impl.UpdateHandlerTracker.close(UpdateHandlerTracker.java:129)
      	at org.apache.sling.installer.core.impl.OsgiInstallerImpl.deactivate(OsgiInstallerImpl.java:190)
      	at org.apache.sling.installer.core.impl.Activator.stop(Activator.java:93)
      	at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:720)
      	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2795)
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1557)
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.base/java.lang.Thread.run(Thread.java:830)
      24.02.2020 20:19:44.233 *ERROR* [FelixStartLevel] ERROR: Bundle '19' EventDispatcher: Error during dispatch. (java.lang.IllegalStateException: Invalid BundleContext.)
      java.lang.IllegalStateException: Invalid BundleContext.
      	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:491)
      	at org.apache.felix.framework.BundleContextImpl.ungetService(BundleContextImpl.java:455)
      	at org.osgi.util.tracker.ServiceTracker.removedService(ServiceTracker.java:456)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:956)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:864)
      	at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:902)
      	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
      	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
      	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
      	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833)
      	at org.apache.felix.framework.Felix.access$000(Felix.java:112)
      	at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:434)
      	at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
      	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:145)
      	at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:241)
      	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2820)
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1557)
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.base/java.lang.Thread.run(Thread.java:830)
      24.02.2020 20:19:44.234 *ERROR* [FelixStartLevel] ERROR: Bundle '19' Error stopping slinginstall:org.apache.sling.installer.core-3.10.1-SNAPSHOT.jar (java.lang.IllegalStateException: Service already unregistered.)
      java.lang.IllegalStateException: Service already unregistered.
      	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:141)
      	at org.apache.sling.installer.core.impl.UpdateHandlerTracker.updateUrlStreamHandler(UpdateHandlerTracker.java:90)
      	at org.apache.sling.installer.core.impl.UpdateHandlerTracker.close(UpdateHandlerTracker.java:129)
      	at org.apache.sling.installer.core.impl.OsgiInstallerImpl.deactivate(OsgiInstallerImpl.java:190)
      	at org.apache.sling.installer.core.impl.Activator.stop(Activator.java:93)
      	at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:720)
      	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2795)
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1557)
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.base/java.lang.Thread.run(Thread.java:830)
      

      This is a regression of SLING-8877 due to the fact that the code tries to unregister the same service multiple times.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kwin Konrad Windszus
                Reporter:
                kwin Konrad Windszus
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: