[ 
https://issues.apache.org/jira/browse/FELIX-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689530#action_12689530
 ] 

Felix Meschberger commented on FELIX-979:
-----------------------------------------

This is most probably a corner case being hit upon, since this case of 
NullPointerException can only be thrown if the bundleChanged event is called 
_after_ the BundleActivator.stop method has already terminated when the 
Configuration Admin bundle.

This may be the case, when the framework is stopping the Configuration Admin 
bundle while the framework event dispatcher still has an event pending to be 
delivered to the BundleListener of the stopped Configuration Admin bundle.

The fix in fact is rather simple: I add a flag indicating whether the 
BundleListener.bundleChanged method should actually be handling events received 
or not.

> Config Admin throwing NPE
> -------------------------
>
>                 Key: FELIX-979
>                 URL: https://issues.apache.org/jira/browse/FELIX-979
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.10
>            Reporter: Richard S. Hall
>            Assignee: Felix Meschberger
>
> BJ is working on a test case for DS that uses CM, which is resulting in the 
> following exception:
> java.lang.NullPointerException
>       at 
> org.apache.felix.cm.impl.ConfigurationManager.getCachedConfiguration(ConfigurationManager.java:281)
>       at 
> org.apache.felix.cm.impl.ConfigurationManager.bundleChanged(ConfigurationManager.java:509)
>       at 
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:941)
>       at 
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
>       at 
> org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
> He says, "It seems CM is trying to clean up unbound configurations and 
> barfing." Let me know if more information is needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to