geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-2796) NPE in ClassPathLoader
Date Thu, 20 Apr 2017 21:24:04 GMT

    [ https://issues.apache.org/jira/browse/GEODE-2796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15977564#comment-15977564
] 

ASF subversion and git services commented on GEODE-2796:
--------------------------------------------------------

Commit 48d662aab7ae4110f36a05aadefe9c12b48c1293 in geode's branch refs/heads/feature/GEODE-2632-5
from [~jstewart]
[ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=48d662a ]

GEODE-2796: ClassPathLoader does not blow up with null TCCL


> NPE in ClassPathLoader
> ----------------------
>
>                 Key: GEODE-2796
>                 URL: https://issues.apache.org/jira/browse/GEODE-2796
>             Project: Geode
>          Issue Type: Bug
>          Components: management
>            Reporter: Jared Stewart
>            Assignee: Jared Stewart
>
> It looks like an NPE was introduced by the fix for GEODE-2290:
> {noformat}
> Caused by: java.lang.NullPointerException
>     at org.apache.geode.internal.ClassPathLoader.getResource(ClassPathLoader.java:130)
>     at org.apache.geode.internal.ClassPathLoader.getResourceAsStream(ClassPathLoader.java:239)
>     at org.apache.geode.internal.ClassPathLoader.getResourceAsStream(ClassPathLoader.java:264)
>     at org.apache.geode.internal.GemFireVersion$VersionDescription.<init>(GemFireVersion.java:191)
>     at org.apache.geode.internal.GemFireVersion.getDescription(GemFireVersion.java:52)
>     at org.apache.geode.internal.GemFireVersion.getGemFireVersion(GemFireVersion.java:66)
>     at org.apache.geode.cache.CacheFactory.getVersion(CacheFactory.java:305)
>         ...
> {noformat}
> This is caused by the following method: 
> {noformat}
>  private List<ClassLoader> getClassLoaders() {
>     ArrayList<ClassLoader> classLoaders = new ArrayList<>();
>     if (!excludeTCCL) {
>       classLoaders.add(Thread.currentThread().getContextClassLoader());
>     }
>     classLoaders.add(classLoaderForDeployedJars);
>     return classLoaders;
>   }
> {noformat}
> According to the JavaDocs, `getContextClassLoader()` actually returns null to indicate
the system class loader (rather than actually returning the system class loader).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message