# Spark & ElasticSearch clash (guava)

**URL:** <https://discuss.elastic.co/t/spark-elasticsearch-clash-guava/49485>\
**Category:** Elasticsearch\
**Created:** [May 8, 2016, 2:19pm UTC](https://discuss.elastic.co/t/spark-elasticsearch-clash-guava/49485 "2016-05-08T14:19:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiorY89](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@LiorY89](https://discuss.elastic.co/u/LiorY89)\
**Post date:** [May 8, 2016, 2:19pm UTC](https://discuss.elastic.co/t/spark-elasticsearch-clash-guava/49485/1 "2016-05-08T14:19:27Z")

</div>

Hey, so i have a piece of code which index records into elastic. This code is running with spark and hadoop.  
I just upgraded Elasticsearch to 2.3.1.  
When i'm running my code on the local machine it works great.  
When i'm trying to run it with the spark submit job, i'm getting

> java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;

After searching google, i realized the problem is with guava, so in my pom.xml i just put the  
  
com.google.guava  
guava  
19.0

under the dependencyManagement.

but the error stil happen, so i guess spark (1.6) is also using an older version of guava, but i can't find where and how to solve it...

---

<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 5, 2017, 10:53pm UTC](https://discuss.elastic.co/t/spark-elasticsearch-clash-guava/49485/2 "2017-07-05T22:53:09Z")

</div>


