You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Karl Pauls (JIRA)" <ji...@apache.org> on 2019/01/25 13:35:00 UTC

[jira] [Resolved] (SLING-8241) NPE in FSClassLoaderProvider deactivate

     [ https://issues.apache.org/jira/browse/SLING-8241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls resolved SLING-8241.
-------------------------------
    Resolution: Fixed

Fixed in d8ca2f5..6e00f59. I just catch exception as there might be other exceptions when the calling bundle is already stopped and it really is a best effort thing to begin with.

> NPE in FSClassLoaderProvider deactivate
> ---------------------------------------
>
>                 Key: SLING-8241
>                 URL: https://issues.apache.org/jira/browse/SLING-8241
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: File System ClassLoader 1.0.8
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>            Priority: Major
>             Fix For: File System ClassLoader 1.0.10
>
>
> 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:
> {noformat}
> 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]
> {noformat}
> We should check if the BundleContext is null first.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)