Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-3820

Possible NPE in ConfigAdmin after shutting down when accessed by bad behaving bundles

    XMLWordPrintableJSON

Details

    Description

      When a bundle accesses the ConfigAdmin service while or after it has been stopped, NPE can occur because the internal ConfigurationAdminImpl#configurationManager field has been nulled.
      While this is a minor issue, it would be better to throw a nicer exception indicating the COnfigAdmin service has been stopped.
      This is mostly for bad behaving bundles that do not react to the service being unregistered though, so it's really a minor issue

      	  at org.apache.felix.cm.impl.ConfigurationAdminImpl.listConfigurations(ConfigurationAdminImpl.java:166)
      	  at org.apache.felix.fileinstall.internal.ConfigInstaller.findExistingConfiguration(ConfigInstaller.java:346)
      	  at org.apache.felix.fileinstall.internal.ConfigInstaller.getConfiguration(ConfigInstaller.java:320)
      	  at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:245)
      	  at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:84)
      	  at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:929)
      	  at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:857)
      	  at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)
      	  at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:224)
      	  at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:252)
      	  at org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:139)
      	  at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
      	  at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2259)
      	  at org.apache.felix.framework.Felix$7.call(Felix.java:2197)
      	  at org.apache.felix.framework.Felix$6.call(Felix.java:2141)
      	  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	  at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	  at java.lang.Thread.run(Thread.java:722)
      

      Attachments

        1. FELIX-3820.patch
          9 kB
          Guillaume Nodet

        Issue Links

          Activity

            People

              fmeschbe Felix Meschberger
              gnodet Guillaume Nodet
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: