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 BC338200B67 for ; Tue, 16 Aug 2016 22:56:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BABDB160AA8; Tue, 16 Aug 2016 20:56:27 +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 0CC59160A74 for ; Tue, 16 Aug 2016 22:56:26 +0200 (CEST) Received: (qmail 24804 invoked by uid 500); 16 Aug 2016 20:56:21 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 24749 invoked by uid 99); 16 Aug 2016 20:56:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2016 20:56:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 05C1F2C02B1 for ; Tue, 16 Aug 2016 20:56:21 +0000 (UTC) Date: Tue, 16 Aug 2016 20:56:21 +0000 (UTC) From: "Sangjin Lee (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-13410) RunJar adds the content of the jar twice to the classpath MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 16 Aug 2016 20:56:27 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15423366#comment-15423366 ] Sangjin Lee commented on HADOOP-13410: -------------------------------------- This should not have any bearing (one way or the other) on HADOOP-12728. If I understood correctly, HADOOP-12728 seems to be an issue of the order between the jar in the argument and what's in the underlying CLASSPATH or HADOOP_CLASSPATH. This JIRA concerns removing the redundant entries for the jar, and does not affect the above ordering problem. > RunJar adds the content of the jar twice to the classpath > --------------------------------------------------------- > > Key: HADOOP-13410 > URL: https://issues.apache.org/jira/browse/HADOOP-13410 > Project: Hadoop Common > Issue Type: Bug > Components: util > Reporter: Sangjin Lee > Assignee: Yuanbo Liu > Fix For: 3.0.0-alpha2 > > Attachments: HADOOP-13410.001.patch > > > Today when you run a "hadoop jar" command, the jar is unzipped to a temporary location and gets added to the classloader. > However, the original jar itself is still added to the classpath. > {code} > 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) { > for (File lib : libs) { > classPath.add(lib.toURI().toURL()); > } > } > {code} > As a result, the contents of the jar are present in the classpath *twice* and are completely redundant. Although this does not necessarily cause correctness issues, some stricter code written to require a single presence of files may fail. > I cannot think of a good reason why the jar should be added to the classpath if the unjarred content was added to it. I think we should remove the jar from the classpath. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org