geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jared Stewart (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GEODE-2796) NPE in ClassPathLoader
Date Tue, 18 Apr 2017 18:33:41 GMT
Jared Stewart created GEODE-2796:
------------------------------------

             Summary: 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


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