[ https://issues.apache.org/jira/browse/FELIX-4210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Jencks resolved FELIX-4210. --------------------------------- Resolution: Cannot Reproduce No info in several months, assuming fixed by 1.8.0 > Error "BundleContext is no longer valid" while activating component > ------------------------------------------------------------------- > > Key: FELIX-4210 > URL: https://issues.apache.org/jira/browse/FELIX-4210 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) > Affects Versions: scr-1.6.0 > Reporter: Christoph Läubrich > Assignee: David Jencks > Priority: Minor > > From time to time the following Exception is thrown in the logs saiing that a > component can't be activated: > !STACK 0 > java.lang.IllegalStateException: BundleContext is no longer valid > at > org.eclipse.osgi.framework.internal.core.BundleContextImpl.checkValid(BundleContextImpl.java:931) > at > org.eclipse.osgi.framework.internal.core.BundleContextImpl.createFilter(BundleContextImpl.java:917) > at > org.apache.felix.scr.impl.manager.DependencyManager.setTargetFilter(DependencyManager.java:1265) > at > org.apache.felix.scr.impl.manager.DependencyManager.<init>(DependencyManager.java:106) > at > org.apache.felix.scr.impl.manager.AbstractComponentManager.loadDependencyManagers(AbstractComponentManager.java:586) > at > org.apache.felix.scr.impl.manager.AbstractComponentManager.<init>(AbstractComponentManager.java:86) > at > org.apache.felix.scr.impl.manager.ImmediateComponentManager.<init>(ImmediateComponentManager.java:86) > at > org.apache.felix.scr.impl.config.AbstractComponentHolder.createComponentManager(AbstractComponentHolder.java:54) > at > org.apache.felix.scr.impl.config.ConfiguredComponentHolder.<init>(ConfiguredComponentHolder.java:99) > at > org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.createComponentHolder(ConfigurationComponentRegistry.java:115) > at > org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:244) > at > org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147) > at > org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111) > at > org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:285) > at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:203) > at > org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847) > at > org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) > at > org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) > at > org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1523) > at > org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1459) > at > org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1454) > at > org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391) > at > org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389) > at > org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131) > at > org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559) > at > org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544) > at > org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457) > at > org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) > at > org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438) > at > org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1) > at > org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) > at > org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) > The problem seems, that SCR tries to create Filter for a component, but was > deactivated/refreshed in the process of doing so. > The API > (http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#createFilter%28java.lang.String%29) > says: > java.lang.IllegalStateException - If this BundleContext is no longer valid. > so it seems valid for me that SCR catch and silently ignore this instead of > reporting this as an error of the component beeing activated. -- This message was sent by Atlassian JIRA (v6.2#6252)