diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java index 57e3bb9..5276fcb 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java @@ -768,11 +768,10 @@ public void sanitizeEnv(Map environment, Path pwd, mergedEnv.putAll(environment); String[] jarCp = FileUtil.createJarWithClassPath( - newClassPath.toString(), nmPrivateClasspathJarDir, pwd, mergedEnv); - // In a secure cluster the classpath jar must be localized to grant access - Path localizedClassPathJar = exec.localizeClasspathJar( - new Path(jarCp[0]), pwd, container.getUser()); - String replacementClassPath = localizedClassPathJar.toString() + jarCp[1]; + newClassPath.toString(), pwd, mergedEnv); + String classPathJar = jarCp[0]; + this.exec.localizeClasspathJar(new Path(classPathJar), pwd, container.getUser()); + String replacementClassPath = classPathJar + jarCp[1]; environment.put(Environment.CLASSPATH.name(), replacementClassPath); } }