hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Motter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13410) RunJar adds the content of the jar twice to the classpath
Date Fri, 28 Oct 2016 21:42:59 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-13410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15616684#comment-15616684
] 

Matt Motter commented on HADOOP-13410:
--------------------------------------

[~sjlee0],

{quote}
That should address your issue too, correct?
{quote}

Yes, removing the unpacked root ("unpacked/") and adding the jar back in, while still retaining
the unpacked classes ("unpacked/classes") and libs ("unpacked/libs") would fix the issue I
described above.

> 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
>         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<URL> 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


Mime
View raw message