# Exception using elastic-hadoop library for Apache Spark

**URL:** <https://discuss.elastic.co/t/exception-using-elastic-hadoop-library-for-apache-spark/90286>\
**Category:** Elasticsearch\
**Created:** [June 21, 2017, 12:35pm UTC](https://discuss.elastic.co/t/exception-using-elastic-hadoop-library-for-apache-spark/90286 "2017-06-21T12:35:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vittorio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vittorio/32/18171_2.png) [@Vittorio](https://discuss.elastic.co/u/Vittorio)\
**Post date:** [June 21, 2017, 12:35pm UTC](https://discuss.elastic.co/t/exception-using-elastic-hadoop-library-for-apache-spark/90286/1 "2017-06-21T12:35:27Z")

</div>

Hi all,

I'm new to the world of apache spark/hadoop and I'm trying the simple examples i found on the elasticsearch/spark web page to simply read/write data to elasticsearch from the spark-shell.

I've tried to write data, and it worked just fine! When I read it works but then when i try to show the content of the RDD doing `RDD.collect()` it throws and exception:

```
scala> RDD.collect()
17/06/21 14:26:50 ERROR Executor: Exception in task 0.0 in stage 3.0 (TID 13)
java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
	at org.elasticsearch.spark.rdd.AbstractEsRDDIterator.<init>(AbstractEsRDDIterator.scala:28)
	at org.elasticsearch.spark.rdd.ScalaEsRDDIterator.<init>(ScalaEsRDD.scala:43)
	at org.elasticsearch.spark.rdd.ScalaEsRDD.compute(ScalaEsRDD.scala:39)
	at org.elasticsearch.spark.rdd.ScalaEsRDD.compute(ScalaEsRDD.scala:33)
	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
	at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
	at org.apache.spark.scheduler.Task.run(Task.scala:99)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:322)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

```

I'm using Scala version 2.11.8, spark version 2.1.1 and elasticsearch-hadoop-5.4.1.jar.  
thanks

---

<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:** [July 19, 2017, 12:36pm UTC](https://discuss.elastic.co/t/exception-using-elastic-hadoop-library-for-apache-spark/90286/2 "2017-07-19T12:36:07Z")

</div>

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