You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stephen Marquard (JIRA)" <ji...@apache.org> on 2019/04/27 06:50:00 UTC
[jira] [Created] (FELIX-6109) NPE from null listener in
DirectoryWatcher.findListener
Stephen Marquard created FELIX-6109:
---------------------------------------
Summary: NPE from null listener in DirectoryWatcher.findListener
Key: FELIX-6109
URL: https://issues.apache.org/jira/browse/FELIX-6109
Project: Felix
Issue Type: Bug
Components: File Install
Affects Versions: fileinstall-3.6.4
Reporter: Stephen Marquard
This error shows up intermittently in an OSGI application.
{noformat}
*ERROR* [org.osgi.service.cm.ManagedServiceFactory, id=13, bundle=6/file:/opt/ls/bundles/system/org.apache.felix.fileinstall-3.6.4.jar]: Unexpected problem updating configuration org.apache.felix.fileinstall.06a753e4-56fc-42fa-8a5b-c2b0b374581f java.lang.NullPointerException at org.apache.felix.fileinstall.internal.DirectoryWatcher.findListener(DirectoryWatcher.java:533) at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:460) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:247) at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:254) at org.apache.felix.fileinstall.internal.FileInstall$ConfigAdminSupport$Tracker.updated(FileInstall.java:378) at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159) at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93) at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1400) at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) at java.lang.Thread.run(Thread.java:748){noformat}
The NPE seems to imply that there is a null listener in the list of listeners here:
{code:java}
ArtifactListener findListener(File artifact, List<ArtifactListener> listeners)
{
for (ArtifactListener listener : listeners) {
if (listener.canHandle(artifact)) {
return listener;
}
}
return null;
{code}
I don't know how that situation arises (some type of race condition, given that it's unpredictable), but seems like it should be easy enough to check for and ignore.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)