aboutsummaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
Diffstat (limited to 'yarn')
-rw-r--r--yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
index e9a02baafd..a2c4bc2f54 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
@@ -1045,7 +1045,10 @@ object Client extends Logging {
s"in favor of the $CONF_SPARK_JAR configuration variable.")
System.getenv(ENV_SPARK_JAR)
} else {
- SparkContext.jarOfClass(this.getClass).head
+ SparkContext.jarOfClass(this.getClass).getOrElse(throw new SparkException("Could not "
+ + "find jar containing Spark classes. The jar can be defined using the "
+ + "spark.yarn.jar configuration option. If testing Spark, either set that option or "
+ + "make sure SPARK_PREPEND_CLASSES is not set."))
}
}