diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index f54bd451c3c..e3544ff91f2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -1178,8 +1178,7 @@ public class ResourceManager extends CompositeService if (null == onDiskPath) { String war = "hadoop-yarn-ui-" + VersionInfo.getVersion() + ".war"; - URLClassLoader cl = (URLClassLoader) ClassLoader.getSystemClassLoader(); - URL url = cl.findResource(war); + URL url = getClass().getClassLoader().getResource(war); if (null == url) { onDiskPath = getWebAppsPath("ui2");