aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSandy Ryza <sandy@cloudera.com>2014-09-12 16:48:28 -0500
committerThomas Graves <tgraves@apache.org>2014-09-12 16:48:28 -0500
commit1d767967e925f1d727957c2d43383ef6ad2c5d5e (patch)
tree1e8f6e0a7f655bc52d5399fd7985bd289a9ad0c2 /core
parent15a564598fe63003652b1e24527c432080b5976c (diff)
downloadspark-1d767967e925f1d727957c2d43383ef6ad2c5d5e.tar.gz
spark-1d767967e925f1d727957c2d43383ef6ad2c5d5e.tar.bz2
spark-1d767967e925f1d727957c2d43383ef6ad2c5d5e.zip
SPARK-3014. Log a more informative messages in a couple failure scenario...
...s Author: Sandy Ryza <sandy@cloudera.com> Closes #1934 from sryza/sandy-spark-3014 and squashes the following commits: ae19cc1 [Sandy Ryza] SPARK-3014. Log a more informative messages in a couple failure scenarios
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
index 0fdb5ae3c2..5ed3575816 100644
--- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
@@ -18,7 +18,7 @@
package org.apache.spark.deploy
import java.io.{File, PrintStream}
-import java.lang.reflect.InvocationTargetException
+import java.lang.reflect.{Modifier, InvocationTargetException}
import java.net.URL
import scala.collection.mutable.{ArrayBuffer, HashMap, Map}
@@ -323,7 +323,9 @@ object SparkSubmit {
}
val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
-
+ if (!Modifier.isStatic(mainMethod.getModifiers)) {
+ throw new IllegalStateException("The main method in the given main class must be static")
+ }
try {
mainMethod.invoke(null, childArgs.toArray)
} catch {