Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-8241

NPE in FSClassLoaderProvider deactivate

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: File System ClassLoader 1.0.8
    • Component/s: Commons
    • Labels:
      None

      Description

      The FSClassLoaderProvider deactivate()->destroyClassLoader() does assume that the callingBundle.getBundleContext() isn't null. That is not the case if the calling bundle has been stopped. In that case, we run into an NPE:

      java.lang.NullPointerException: null
      at org.apache.sling.commons.fsclassloader.impl.FSClassLoaderProvider.destroyClassLoader(FSClassLoaderProvider.java:178) [org.apache.sling.commons.fsclassloader:1.0.8]
      at org.apache.sling.commons.fsclassloader.impl.FSClassLoaderProvider.deactivate(FSClassLoaderProvider.java:160) [org.apache.sling.commons.fsclassloader:1.0.8]
      

      We should check if the BundleContext is null first.

        Attachments

          Activity

            People

            • Assignee:
              karlpauls Karl Pauls
              Reporter:
              karlpauls Karl Pauls
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: