# Multiple ES-Hadoop versions (5.1.2)

**URL:** https://discuss.elastic.co/t/multiple-es-hadoop-versions-5-1-2/74310
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [February 8, 2017, 2:29am UTC](https://discuss.elastic.co/t/multiple-es-hadoop-versions-5-1-2/74310 "2017-02-08T02:29:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![David\_she](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_she/32/48792_2.png) [@David\_she](https://discuss.elastic.co/u/David_she)
#### Post date: [February 8, 2017, 2:29am UTC](https://discuss.elastic.co/t/multiple-es-hadoop-versions-5-1-2/74310/1 "2017-02-08T02:29:24Z")

</div>

Hi,

I'm getting the following error.  
Error: Multiple ES-Hadoop versions detected in the classpath; please use only one

I can not find any other instances of elasticsearch-hadoop on the server and not in my jar.  
I even ran:  
find . -name "\*.jar" -exec zipgrep -i "elasticsearch-hadoop" '{}' ;  
Just to make sure there was nothing in any of the jars in the classpath. We are using a Cloudera distribution.

I am reading from HBase and writing to ES (5.1.2). Reading and writing to ES is fine and reading and writing to HBase is fine in a mapreduce job. But when reading from HBase and writing to ES (in the reducer) it errors. If I don't write to ES and simply print to stdout I have no issues either.

Driving me nuts ☹  
Any hints?

Little more info.  
Added some debug code to the reducer (see very bottom). Looks like it's producing two jars when using both HBase and ES in the same mapreduce job.

Target: org/elasticsearch/hadoop/util/Version.class  
URL: jar:file:/u09/hadoop/yarn/nm/usercache/root/appcache/application\_1483942272862\_0507/filecache/10/job.jar/job.jar!/org/elasticsearch/hadoop/util/Version.class  
URL: jar:file:/u12/hadoop/yarn/nm/usercache/root/filecache/3346/xxxxxxxxx.jar!/org/elasticsearch/hadoop/util/Version.class

Debug code:  
String target = Version.class.getName().replace(".", "/").concat(".class");  
System.out.println("Target: " + target);  
Enumeration res = null;

```
        try {
            res = Version.class.getClassLoader().getResources(target);
        } catch (IOException ex) {
            System.out.println("Issue: " );
        }

        if (res != null) {
            List<URL> urls = Collections.list(res);

            for (URL url : urls) {
                System.out.println("URL: " + url.toString());
            }
        }
```

---

<div class="post-metadata">

### Author: ![David\_she](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_she/32/48792_2.png) [@David\_she](https://discuss.elastic.co/u/David_she)
#### Post date: [February 8, 2017, 9:18pm UTC](https://discuss.elastic.co/t/multiple-es-hadoop-versions-5-1-2/74310/2 "2017-02-08T21:18:30Z")

</div>

Found a work around.  
Extend the following two classes:  
EsOutputFormat  
RestService  
We removed the call to "Version.logVersion();" in the RestService  
Note ensure the new classes are in the same package names as the original  
Pain in the butt but works until addressed in source code.  
😌

Happy to share classes if anyone else is stuck

---

<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: [February 14, 2017, 8:31pm UTC](https://discuss.elastic.co/t/multiple-es-hadoop-versions-5-1-2/74310/3 "2017-02-14T20:31:57Z")

</div>

@David_she There are many issues that this check guards against, and in modifying the used artifacts it makes troubleshooting issues within the community incredibly difficult. I would advise against removing the Version check, and would like to reinforce the importance of having a single version of the jar available to each job's classpath.

---

<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: [March 14, 2017, 8:32pm UTC](https://discuss.elastic.co/t/multiple-es-hadoop-versions-5-1-2/74310/4 "2017-03-14T20:32:46Z")

</div>

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