You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by jgarrett <jo...@noblis-nsp.com> on 2014/11/05 19:27:48 UTC
Not Specifying --class for spark-submit
Hey all,
I am trying to run spark-submit on a Jar file without specifying the --class
parameter so that it will load the jar's main class. Using the following
command:
spark-submit MyJar.jar
I get this error:
Error: Cannot load main class from JAR: file:/MyJar.jar
After digging into the issue, it seems that the problem occurs on this line:
https://github.com/apache/spark/blob/2f54543815c0905dc958d444ad638c23a29507c6/core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala#L127
The JarFile constructor does not like the "file:/" that was prepended to the
file name.
I tried opening up the scala console and trying it out myself and confirmed
that 'new JarFile("file:/MyJar.jar")' does throw a FileNotFoundException,
while 'new JarFile("MyJar.jar")' works as expected.
Has anyone encountered this issue or know of a way around it? I would like
to avoid specifying the --class parameter if possible.
Thanks,
- Johnathan Garrett
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Not-Specifying-class-for-spark-submit-tp18205.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org