# Getting Error on sc.esRDD ES-Hadoop 5.2.2 Spark version 2.1.0

**URL:** <https://discuss.elastic.co/t/getting-error-on-sc-esrdd-es-hadoop-5-2-2-spark-version-2-1-0/80198>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [March 27, 2017, 7:45pm UTC](https://discuss.elastic.co/t/getting-error-on-sc-esrdd-es-hadoop-5-2-2-spark-version-2-1-0/80198 "2017-03-27T19:45:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![werowe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/werowe/32/47523_2.png) [@werowe](https://discuss.elastic.co/u/werowe)\
**Post date:** [March 27, 2017, 7:45pm UTC](https://discuss.elastic.co/t/getting-error-on-sc-esrdd-es-hadoop-5-2-2-spark-version-2-1-0/80198/1 "2017-03-27T19:45:22Z")

</div>

Am I missing something in the --jars option? Or maybe Scala version in ES does not match Spark version?

I am using this to start the Scala shell in Spark:

spark-shell --master local --jars /usr/local/spark/elasticsearch-hadoop-5.2.2/dist/elasticsearch-spark-20\_2.10-5.2.2.jar

And I can successfully import org.elasticsearch.spark.\_

But when I:

val RDD = sc.esRDD("filebeat-2017.03.26")  
RDD.count()

I get

46 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)  
java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class  
at org.elasticsearch.spark.rdd.AbstractEsRDDIterator.(AbstractEsRDDIterator.scala:28)  
at org.elasticsearch.spark.rdd.ScalaEsRDDIterator.(ScalaEsRDD.scala:43)  
at org.elasticsearch.spark.rdd.ScalaEsRDD.compute(ScalaEsRDD.scala:39)  
at org.elasticsearch.spark.rdd.ScalaEsRDD.compute(ScalaEsRDD.scala:33)

Maybe there is some version mismatch?

Spark version 2.1.0  
Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0\_121)  
ES-Hadoop 5.2.2  
elasticsearch 5.2.2

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [March 28, 2017, 2:38pm UTC](https://discuss.elastic.co/t/getting-error-on-sc-esrdd-es-hadoop-5-2-2-spark-version-2-1-0/80198/3 "2017-03-28T14:38:38Z")

</div>

> [@werowe](#):
>
> Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0\_121)

> [@werowe](#):
>
> spark-shell --master local --jars /usr/local/spark/elasticsearch-hadoop-5.2.2/dist/elasticsearch-spark-20\_2.10-5.2.2.jar

Your ES-Hadoop artifact is the Scala 2.10 compatibility jar. The version numbers for the spark artifact are of the format `elasticsearch-spark-{$sparkMajorMinorVersionNoDots}_{$scalaVersion}-{$esHadoopVersion}.jar`. You will need to use `elasticsearch-spark-20_2.11-5.2.2.jar` instead of the `_2.10` version.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2017, 2:38pm UTC](https://discuss.elastic.co/t/getting-error-on-sc-esrdd-es-hadoop-5-2-2-spark-version-2-1-0/80198/4 "2017-04-25T14:38:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
