java.lang.IllegalStateException: Invalid BundleContext.

Atlassian JIRA | Stephen Brannen | 1 year ago
  1. 0

    h3. Summary When shutting down Confluence using the service or via shutdown.sh or shutdown.bat, it can throw errors. When this happens, Confluence will appear to hang and the shutdown process is extremely slow h3. Steps to Reproduce # Install Confluence 5.8.13 # Start Confluence # Let Confluence run for a bit # Shutdown Confluence h3. Expected Results Confluence shutsdown without issue h3. Actual Results Confluence can hang on shutdown and throw errors in the logs, for example the below exception is thrown in the atlassian-confluence.log file: {noformat} 2015-10-21 12:23:13,174 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.plugin.notifications.notifications-module, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs 2015-10-21 12:23:13,174 ERROR [localhost-startStop-2] [support.internal.aop.ServiceDynamicInterceptor] serviceChanged Exception during service event handling java.lang.IllegalStateException: Invalid BundleContext. at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514) at org.apache.felix.framework.BundleContextImpl.getServiceReferences(BundleContextImpl.java:425) at org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReferences(OsgiServiceReferenceUtils.java:159) at org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReference(OsgiServiceReferenceUtils.java:76) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:195) at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793) at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4419) at org.apache.felix.framework.Felix.access$000(Felix.java:74) at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:401) at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:151) at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:127) at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:196) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2555) at org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2632) at org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:1022) at com.atlassian.plugin.osgi.factory.OsgiPlugin.uninstallInternal(OsgiPlugin.java:503) at com.atlassian.plugin.impl.AbstractPlugin.uninstall(AbstractPlugin.java:425) at com.atlassian.plugin.impl.AbstractDelegatingPlugin.uninstall(AbstractDelegatingPlugin.java:196) at com.atlassian.plugin.loaders.ScanningPluginLoader.onShutdown(ScanningPluginLoader.java:245) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73) at com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:73) at com.atlassian.plugin.manager.DefaultPluginManager.broadcast(DefaultPluginManager.java:608) at com.atlassian.plugin.manager.DefaultPluginManager.shutdown(DefaultPluginManager.java:598) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextDestroyed(PluginFrameworkContextListener.java:77) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {noformat} h3. Workaround * Start/shutdown Confluence using {{start-confluence.sh}} and {{stop-confluence.sh}} (or .bat if you are on Windows)

    Atlassian JIRA | 1 year ago | Stephen Brannen
    java.lang.IllegalStateException: Invalid BundleContext.
  2. 0

    h3. Summary When shutting down Confluence using the service or via shutdown.sh or shutdown.bat, it can throw errors. When this happens, Confluence will appear to hang and the shutdown process is extremely slow h3. Steps to Reproduce # Install Confluence 5.8.13 # Start Confluence # Let Confluence run for a bit # Shutdown Confluence h3. Expected Results Confluence shutsdown without issue h3. Actual Results Confluence can hang on shutdown and throw errors in the logs, for example the below exception is thrown in the atlassian-confluence.log file: {noformat} 2015-10-21 12:23:13,174 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.plugin.notifications.notifications-module, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs 2015-10-21 12:23:13,174 ERROR [localhost-startStop-2] [support.internal.aop.ServiceDynamicInterceptor] serviceChanged Exception during service event handling java.lang.IllegalStateException: Invalid BundleContext. at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514) at org.apache.felix.framework.BundleContextImpl.getServiceReferences(BundleContextImpl.java:425) at org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReferences(OsgiServiceReferenceUtils.java:159) at org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReference(OsgiServiceReferenceUtils.java:76) at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:195) at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793) at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4419) at org.apache.felix.framework.Felix.access$000(Felix.java:74) at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:401) at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:151) at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:127) at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:196) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2555) at org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2632) at org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:1022) at com.atlassian.plugin.osgi.factory.OsgiPlugin.uninstallInternal(OsgiPlugin.java:503) at com.atlassian.plugin.impl.AbstractPlugin.uninstall(AbstractPlugin.java:425) at com.atlassian.plugin.impl.AbstractDelegatingPlugin.uninstall(AbstractDelegatingPlugin.java:196) at com.atlassian.plugin.loaders.ScanningPluginLoader.onShutdown(ScanningPluginLoader.java:245) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73) at com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:73) at com.atlassian.plugin.manager.DefaultPluginManager.broadcast(DefaultPluginManager.java:608) at com.atlassian.plugin.manager.DefaultPluginManager.shutdown(DefaultPluginManager.java:598) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextDestroyed(PluginFrameworkContextListener.java:77) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {noformat} h3. Workaround * Start/shutdown Confluence using {{start-confluence.sh}} and {{stop-confluence.sh}} (or .bat if you are on Windows)

    Atlassian JIRA | 1 year ago | Stephen Brannen
    java.lang.IllegalStateException: Invalid BundleContext.
  3. 0

    [Feed Cycle Renderer] IllegalStateException on shutdown

    GitHub | 3 years ago | VWoeltjen
    java.lang.IllegalStateException: Invalid BundleContext.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Stop/Start Bundle

    aries-user | 3 years ago | S├ębastien Nicouleau
    java.lang.IllegalStateException: Invalid BundleContext.
  6. 0

    Stop/Start Bundle

    incubator-aries-user | 3 years ago | S├ębastien Nicouleau
    java.lang.IllegalStateException: Invalid BundleContext.

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Invalid BundleContext.

      at org.apache.felix.framework.BundleContextImpl.checkValidity()
    2. Apache Felix Framework
      BundleContextImpl.getServiceReferences
      1. org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514)
      2. org.apache.felix.framework.BundleContextImpl.getServiceReferences(BundleContextImpl.java:425)
      2 frames
    3. Spring OSGi Core
      ServiceDynamicInterceptor$Listener.serviceChanged
      1. org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReferences(OsgiServiceReferenceUtils.java:159)
      2. org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReference(OsgiServiceReferenceUtils.java:76)
      3. org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:195)
      3 frames
    4. Apache Felix Framework
      BundleImpl.uninstall
      1. org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
      2. org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
      3. org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
      4. org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4419)
      5. org.apache.felix.framework.Felix.access$000(Felix.java:74)
      6. org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:401)
      7. org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:151)
      8. org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:127)
      9. org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:196)
      10. org.apache.felix.framework.Felix.stopBundle(Felix.java:2555)
      11. org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2632)
      12. org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:1022)
      12 frames
    5. com.atlassian.plugin
      ScanningPluginLoader.onShutdown
      1. com.atlassian.plugin.osgi.factory.OsgiPlugin.uninstallInternal(OsgiPlugin.java:503)
      2. com.atlassian.plugin.impl.AbstractPlugin.uninstall(AbstractPlugin.java:425)
      3. com.atlassian.plugin.impl.AbstractDelegatingPlugin.uninstall(AbstractDelegatingPlugin.java:196)
      4. com.atlassian.plugin.loaders.ScanningPluginLoader.onShutdown(ScanningPluginLoader.java:245)
      4 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    7. com.atlassian.event
      AsynchronousAbleEventDispatcher$1$1.run
      1. com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)
      2. com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48)
      2 frames
    8. Guava
      MoreExecutors$SameThreadExecutorService.execute
      1. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
      1 frame
    9. com.atlassian.event
      EventPublisherImpl.publish
      1. com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107)
      2. com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
      3. com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)
      3 frames
    10. com.atlassian.confluence
      TimingEventPublisher.publish
      1. com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73)
      1 frame
    11. com.atlassian.plugin
      DefaultPluginManager.shutdown
      1. com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:73)
      2. com.atlassian.plugin.manager.DefaultPluginManager.broadcast(DefaultPluginManager.java:608)
      3. com.atlassian.plugin.manager.DefaultPluginManager.shutdown(DefaultPluginManager.java:598)
      3 frames
    12. com.atlassian.confluence
      PluginFrameworkContextListener.contextDestroyed
      1. com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextDestroyed(PluginFrameworkContextListener.java:77)
      1 frame
    13. Glassfish Core
      ContainerBase$StopChild.call
      1. org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
      2. org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
      3. org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      4. org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
      5. org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413)
      5 frames
    14. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(Unknown Source)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      4. java.lang.Thread.run(Unknown Source)
      4 frames