Skip to content

Commit 8da7cbf

Browse files
author
Brennon York
committed
fixes SPARK-4298
1 parent 5af53ad commit 8da7cbf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.deploy
1919

20+
import java.net.URI
2021
import java.util.jar.JarFile
2122

2223
import scala.collection.mutable.{ArrayBuffer, HashMap}
@@ -124,12 +125,13 @@ private[spark] class SparkSubmitArguments(args: Seq[String], env: Map[String, St
124125
// Try to set main class from JAR if no --class argument is given
125126
if (mainClass == null && !isPython && primaryResource != null) {
126127
try {
127-
val jar = new JarFile(primaryResource)
128+
val jar = new JarFile(new URI(primaryResource).getPath)
128129
// Note that this might still return null if no main-class is set; we catch that later
129130
mainClass = jar.getManifest.getMainAttributes.getValue("Main-Class")
130131
} catch {
131132
case e: Exception =>
132-
SparkSubmit.printErrorAndExit("Cannot load main class from JAR: " + primaryResource)
133+
SparkSubmit.printErrorAndExit("Cannot main: " + primaryResource)
134+
//SparkSubmit.printErrorAndExit("Cannot load main class from JAR: " + primaryResource)
133135
return
134136
}
135137
}

0 commit comments

Comments
 (0)