# Resolving Jar hell

**URL:** <https://discuss.elastic.co/t/resolving-jar-hell/212632>\
**Category:** Elasticsearch\
**Created:** [December 20, 2019, 9:12am UTC](https://discuss.elastic.co/t/resolving-jar-hell/212632 "2019-12-20T09:12:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie111985](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/newbie111985/32/17561_2.png) [@Newbie111985](https://discuss.elastic.co/u/Newbie111985)\
**Post date:** [December 20, 2019, 9:12am UTC](https://discuss.elastic.co/t/resolving-jar-hell/212632/1 "2019-12-20T09:12:33Z")

</div>

I have a custom plugin for Elasticsearch which has a dependency on httpclient and httpcore jar files. I see that these jars are part of Elasticsearch installation and hence want to use them instead of packaging these jars in my custom plugin.  
So, I updated ES\_CLASSPATH variable in $ES\_HOME/bin/elasticsearch-env as follows:  
ES\_CLASSPATH="$ES\_HOME/lib/\*:$ES\_HOME/modules/reindex/httpclient-4.5.2.jar:$ES\_HOME/modules/reindex/httpcore-4.4.5.jar"

With above configuration I trying to start Elasticsearch server but I am getting below error:

Caused by: java.lang.IllegalStateException: jar hell! duplicate codebases between plugin and core: [file:/usr/share/elasticsearch/modules/reindex/httpclient-4.5.2.jar, file:/usr/share/elasticsearch/modules/reindex/httpcore-4.4.5.jar]  
at org.elasticsearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:517) ~[elasticsearch-6.8.4.jar:6.8.4]  
... 14 more

If I remove including these jars in ES\_CLASSPATH variable and try to start Elasticsearch server, I am getting below error:

Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpEntity  
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0\_40]  
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0\_40]  
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:810) ~[?:1.8.0\_40]  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0\_40]  
... 15 more

So how can I add httpclient and httpcore jars to my plugin classpath?

Thanks in advance.

---

<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:** [January 17, 2020, 9:12am UTC](https://discuss.elastic.co/t/resolving-jar-hell/212632/2 "2020-01-17T09:12:38Z")

</div>

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