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

NPE in FSClassLoaderProvider deactivate

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • File System ClassLoader 1.0.8
    • Commons
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment