# Exception when using Elasticsearch-spark and Elasticsearch-core together

**URL:** <https://discuss.elastic.co/t/exception-when-using-elasticsearch-spark-and-elasticsearch-core-together/38471>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [January 6, 2016, 7:29am UTC](https://discuss.elastic.co/t/exception-when-using-elasticsearch-spark-and-elasticsearch-core-together/38471 "2016-01-06T07:29:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dynamicscope](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@dynamicscope](https://discuss.elastic.co/u/dynamicscope)\
**Post date:** [January 7, 2016, 5:35am UTC](https://discuss.elastic.co/t/exception-when-using-elasticsearch-spark-and-elasticsearch-core-together/38471/4 "2016-01-07T05:35:08Z")

</div>

Thank you for your hints.

I solved this issue by adding

`exclude("org.apache.spark", "spark-network-common_2.10")`

instead of

`exclude("com.google.guava", "guava")`

It looks like **spark-network-common\_2.10** contains guava classes.  
So the finally **build.sbt** includes the following...

```
// Exclude jars that conflict with Spark (see https://github.com/sbt/sbt-assembly)
libraryDependencies ~= { _ map {
  case m if Seq("org.elasticsearch").contains(m.organization) =>
    m.exclude("commons-logging", "commons-logging").
      exclude("commons-collections", "commons-collections").
      exclude("commons-beanutils", "commons-beanutils-core").
      exclude("com.esotericsoftware.minlog", "minlog").
      exclude("joda-time", "joda-time").
      exclude("org.apache.commons", "commons-lang3").
      exclude("org.apache.spark", "spark-network-common_2.10")
  case m => m
}}
```

---

_[View the full topic](https://discuss.elastic.co/t/exception-when-using-elasticsearch-spark-and-elasticsearch-core-together/38471)._
