# Jar hell when installing custom plugin

**URL:** <https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938>\
**Category:** Elasticsearch\
**Created:** [January 20, 2019, 12:43pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938 "2019-01-20T12:43:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninesalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninesalt/32/39981_2.png) [@ninesalt](https://discuss.elastic.co/u/ninesalt)\
**Post date:** [January 20, 2019, 12:43pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938/1 "2019-01-20T12:43:26Z")

</div>

I'm trying to install a custom plugin I'm working on which includes CoreNLP. I'm getting the jar hell error with the following jars:

```
Caused by: java.lang.IllegalStateException: jar hell!
class: com.sun.xml.bind.Locatable
jar1: /usr/share/elasticsearch/plugins/.installing-6011384642713418918/jaxb-impl-2.4.0-b180830.0438.jar
jar2: /usr/share/elasticsearch/plugins/.installing-6011384642713418918/jaxb-core-2.3.0.1.jar
    at org.elasticsearch.bootstrap.JarHell.checkClass(JarHell.java:277)
    at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:190)
    at org.elasticsearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:503)
    ... 12 more

```

What am I doing wrong? Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 20, 2019, 12:56pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938/2 "2019-01-20T12:56:48Z")

</div>

Your plugin seems to have 2 jaxb implementations (different versions and artifact names). You should fix it by checking the dependency tree of your plugin.

---

<div class="post-metadata">

**Author:** ![ninesalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninesalt/32/39981_2.png) [@ninesalt](https://discuss.elastic.co/u/ninesalt)\
**Post date:** [January 20, 2019, 1:00pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938/3 "2019-01-20T13:00:03Z")

</div>

I'm only using coreNLP so I'm not sure whats happening. Here's the dependency section of my pom.xml file. I'm following [this](https://github.com/TechnocratSid/elastic-sentiment-analysis-plugin/blob/master/pom.xml) exactly, I only bumped the ES and coreNLP versions.

```
 <dependencies>
    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-corenlp</artifactId>
        <version>3.9.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-sandbox</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-analyzers-common</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-queries</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-queryparser</artifactId>
            </exclusion>
            <exclusion>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-corenlp</artifactId>
        <version>3.9.2</version>
        <classifier>models</classifier>
        <exclusions>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-sandbox</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-analyzers-common</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-queries</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-queryparser</artifactId>
            </exclusion>
            <exclusion>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>${elasticsearch.version}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

```

and below is the truncated output of `mvn dependency:tree`:

```
[INFO] es-corenlp:es-corenlp:jar:1.0-SNAPSHOT
[INFO] +- edu.stanford.nlp:stanford-corenlp:jar:3.9.2:compile
[INFO] | +- com.apple:AppleJavaExtensions:jar:1.4:compile
[INFO] | +- de.jollyday:jollyday:jar:0.4.9:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.3.1:compile
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.0.1:compile
[INFO] | +- com.io7m.xom:xom:jar:1.2.10:compile
[INFO] | | +- xml-apis:xml-apis:jar:1.3.03:compile
[INFO] | | +- xerces:xercesImpl:jar:2.8.0:compile
[INFO] | | \- xalan:xalan:jar:2.7.0:compile
[INFO] | +- com.googlecode.efficient-java-matrix-library:ejml:jar:0.23:compile
[INFO] | +- org.glassfish:javax.json:jar:1.0.4:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:3.2.0:compile
[INFO] | +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.4.0-b180830.0359:compile
[INFO] | +- **com.sun.xml.bind:jaxb-core:jar:2.3.0.1:compile**
[INFO] | \- **com.sun.xml.bind:jaxb-impl:jar:2.4.0-b180830.0438:compile**
[INFO] +- edu.stanford.nlp:stanford-corenlp:jar:models:3.9.2:compile

```

I dont understand why this is causing a jar hell error, the packages are clearly different. They have different names and versions. What gives?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 20, 2019, 3:14pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938/4 "2019-01-20T15:14:43Z")

</div>

The problem is then in stanford-corenlp

Try to exclude one of the libs may be?

---

<div class="post-metadata">

**Author:** ![ninesalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninesalt/32/39981_2.png) [@ninesalt](https://discuss.elastic.co/u/ninesalt)\
**Post date:** [January 20, 2019, 3:46pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938/5 "2019-01-20T15:46:18Z")

</div>

I probably can't do that because they're both explicitly listed as dependencies in CoreNLP's pom.xml. Anyway, I found another alternative to what I'm doing so I don't need to fix this. Thanks for your help though.

---

<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:** [February 17, 2019, 3:59pm UTC](https://discuss.elastic.co/t/jar-hell-when-installing-custom-plugin/164938/6 "2019-02-17T15:59:48Z")

</div>

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