[ https://issues.apache.org/jira/browse/FELIX-3334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201617#comment-13201617 ]
J.W. Janssen commented on FELIX-3334: ------------------------------------- @Felix: you're right; I was too early with my conclusion. The spec clearly says that bundles are to be unregistered automatically as listeners after being stopped. We actually do encounter the NPE, but we're running multiple instances of the PreferenceService to provide this service in a multi-tenant situation. That said, we also encountered situations that the original fix did not fix the problem either. So, I've changed the code to test for null, which does resolve the issue for our situation. > PreferencesManager can throw NPE after being stopped. > ----------------------------------------------------- > > Key: FELIX-3334 > URL: https://issues.apache.org/jira/browse/FELIX-3334 > Project: Felix > Issue Type: Bug > Components: Preferences Service > Affects Versions: prefs-1.0.4 > Reporter: J.W. Janssen > Labels: patch > Attachments: quickfix-new.patch, quickfix.patch > > > PreferencesManager#bundleChanged tries to intercept bundles that are > uninstalled. However, if the PreferencesManager itself is stopped, it does > not unregister itself as bundle listener, causing possible NPEs when other > bundles depending on the preferences service are stopped later on, for > example during a shutdown. > I've got a patch available, will attach it to this issue to be applied. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira