hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Lowe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12803) RunJar should allow overriding the manifest Main-Class via a cli parameter.
Date Tue, 01 Mar 2016 16:43:18 GMT

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

Jason Lowe commented on HADOOP-12803:
-------------------------------------

Thanks for the patch, Gera!   Unfortunately this breaks backwards compatibility.  For example,
http://wiki.apache.org/hadoop/WordCount references this sample command-line:
{quote}
bin/hadoop jar hadoop-*-examples.jar wordcount [-m <#maps>] [-r <#reducers>] <in-dir>
<out-dir> 
{quote}

With the proposed change it results in this error:
{noformat}
Exception in thread "main" java.lang.ClassNotFoundException: wordcount
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:231)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:139)
{noformat}

I'm not sure how we're going to differentiate a main class from an arbitrary first argument
to pass on.  Previously it used the presence of a main class in the manifest to know whether
the first argument is a main class or the first argument to the program being launched.  Not
necessarily how I would have done it, but that's how it works and users have built things
around those semantics.


> RunJar should allow overriding the manifest Main-Class via a cli parameter.
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-12803
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12803
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 2.6.4
>            Reporter: Gera Shegalov
>            Assignee: Gera Shegalov
>         Attachments: HADOOP-12803.001.patch
>
>
> Currently there is no way to override the main class in the manifest even though main
class can be passed as a parameter.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message