Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9E066200B8B for ; Mon, 19 Sep 2016 22:01:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9CC3D160ADF; Mon, 19 Sep 2016 20:01:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EA80C160ACC for ; Mon, 19 Sep 2016 22:01:32 +0200 (CEST) Received: (qmail 36777 invoked by uid 500); 19 Sep 2016 20:01:25 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 36568 invoked by uid 99); 19 Sep 2016 20:01:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2016 20:01:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 63711E02DA; Mon, 19 Sep 2016 20:01:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: subru@apache.org To: common-commits@hadoop.apache.org Date: Mon, 19 Sep 2016 20:01:30 -0000 Message-Id: <447bc538d78f41aaa8679c5c3673c171@git.apache.org> In-Reply-To: <6f914df7aae4486d986d8b5d278b01a4@git.apache.org> References: <6f914df7aae4486d986d8b5d278b01a4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/44] hadoop git commit: Revert "HADOOP-13410. RunJar adds the content of the jar twice to the classpath (Yuanbo Liu via sjlee)" archived-at: Mon, 19 Sep 2016 20:01:33 -0000 Revert "HADOOP-13410. RunJar adds the content of the jar twice to the classpath (Yuanbo Liu via sjlee)" This reverts commit 4d3ea92f4fe4be2a0ee9849c65cb1c91b0c5711b. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fcbac002 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fcbac002 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fcbac002 Branch: refs/heads/YARN-2915 Commit: fcbac00212e99c91bd1368e002823d1260b3879f Parents: 7cad7b7 Author: Sangjin Lee Authored: Thu Sep 15 10:18:56 2016 -0700 Committer: Sangjin Lee Committed: Thu Sep 15 10:18:56 2016 -0700 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/util/RunJar.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/fcbac002/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java index d91a78b..19b51ad 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java @@ -226,7 +226,7 @@ public class RunJar { unJar(file, workDir); - ClassLoader loader = createClassLoader(workDir); + ClassLoader loader = createClassLoader(file, workDir); Thread.currentThread().setContextClassLoader(loader); Class mainClass = Class.forName(mainClassName, true, loader); @@ -250,13 +250,14 @@ public class RunJar { * the user jar as well as the HADOOP_CLASSPATH. Otherwise, it creates a * classloader that simply adds the user jar to the classpath. */ - private ClassLoader createClassLoader(final File workDir) + private ClassLoader createClassLoader(File file, final File workDir) throws MalformedURLException { ClassLoader loader; // see if the client classloader is enabled if (useClientClassLoader()) { StringBuilder sb = new StringBuilder(); sb.append(workDir).append("/"). + append(File.pathSeparator).append(file). append(File.pathSeparator).append(workDir).append("/classes/"). append(File.pathSeparator).append(workDir).append("/lib/*"); // HADOOP_CLASSPATH is added to the client classpath @@ -276,6 +277,7 @@ public class RunJar { } else { List classPath = new ArrayList<>(); classPath.add(new File(workDir + "/").toURI().toURL()); + classPath.add(file.toURI().toURL()); classPath.add(new File(workDir, "classes/").toURI().toURL()); File[] libs = new File(workDir, "lib").listFiles(); if (libs != null) { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org