org.ops4j.pax.web.pax-web-extender-whiteboard causes exception when shutting down

Steps to reproduce

Since the Karaf 4.0.6 upgrade (see https://bitbucket.org/opencast-community/matterhorn/pull-requests/1191/mh-11797-upgrade-karaf-version-to-406/diff), a new ERROR happens when shutting down Opencast.

Steps to reproduce:
1. Start Opencast
2. Open log on Admin Node
3. Stop Opencast

Actual Results:

Exception occurs:

2016-11-10 16:46:24,226 | WARN | (HttpServiceStopped:86) - Http service has already been stopped
ERROR: Bundle org.ops4j.pax.web.pax-web-extender-whiteboard [285] EventDispatcher: Error during dispatch. (java.lang.IllegalStateException: Invalid BundleContext.)
java.lang.IllegalStateException: Invalid BundleContext.
at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
at org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.removedService(ReplaceableService.java:110)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:377)
at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.stop(ReplaceableService.java:55)
at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.stop(WebApplication.java:119)
at org.ops4j.pax.web.extender.whiteboard.internal.ExtenderContext.removeWebApplication(ExtenderContext.java:86)
at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:220)
at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:44)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
at org.apache.felix.framework.Felix.access$000(Felix.java:106)
at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420)
at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:235)
at org.apache.felix.framework.Felix.stopBundle(Felix.java:2635)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1389)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.lang.Thread.run(Thread.java:745)
2016-11-10 16:46:24,231 | ERROR | (?:?) - FrameworkEvent ERROR - org.ops4j.pax.web.pax-web-extender-whiteboard
java.lang.IllegalStateException: Invalid BundleContext.
at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)[org.apache.felix.framework-5.4.0.jar:]
at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.removedService(ReplaceableService.java:110)[285:org.ops4j.pax.web.pax-web-extender-whiteboard:4.2.8]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:377)[org.osgi.core-6.0.0.jar:]
at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.stop(ReplaceableService.java:55)[285:org.ops4j.pax.web.pax-web-extender-whiteboard:4.2.8]
at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.stop(WebApplication.java:119)[285:org.ops4j.pax.web.pax-web-extender-whiteboard:4.2.8]
at org.ops4j.pax.web.extender.whiteboard.internal.ExtenderContext.removeWebApplication(ExtenderContext.java:86)[285:org.ops4j.pax.web.pax-web-extender-whiteboard:4.2.8]
at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:220)[285:org.ops4j.pax.web.pax-web-extender-whiteboard:4.2.8]
at org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.removedService(AbstractTracker.java:44)[285:org.ops4j.pax.web.pax-web-extender-whiteboard:4.2.8]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)[org.osgi.core-6.0.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.access$000(Felix.java:106)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:235)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.stopBundle(Felix.java:2635)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1389)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)[org.apache.felix.framework-5.4.0.jar:]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

Expected Results:

Exception should not occur

Workaround (if any):

Ignore since we shutdown Opencast anyway.

Assignee

Lars Kiesow

Reporter

Sven Stauber

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

None

Components

Fix versions

Priority

Minor
Configure