# NoClassDefFound Upgrading Jest & Elastic

**URL:** <https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107>\
**Category:** Elasticsearch\
**Created:** [October 16, 2017, 3:09pm UTC](https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107 "2017-10-16T15:09:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjd14](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bjd14](https://discuss.elastic.co/u/bjd14)\
**Post date:** [October 16, 2017, 3:09pm UTC](https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107/1 "2017-10-16T15:09:26Z")

</div>

As the title says I am upgrading Jest and Elasticsearch. Jest from 2.4.0 to 5.3.2 and Elasticsearch from 2.3.3 to 5.4.2. When I build my specific jar file from Gradle then try to do some testing, it is throwing the NoClassDefFoundError.

The specific message I am receiving is,  
`Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.index.query.BoolQueryBuilder`

Checking the jar in a decompiler the specific class "BoolQueryBuilder" class has an "INTERNAL ERROR" message with nothing inside of it but the byte code has information tied to it.

I have tried different jars with the same result. Everything seems to point to some dependency in my gradle file. Are there any main dependencies that would cause class definitions to be lost? Instead of taking shots in the dark I figured I would ask about any giant red flags others have possibly dealt with?

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [October 23, 2017, 6:08pm UTC](https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107/2 "2017-10-23T18:08:39Z")

</div>

Do you have log files you can put in a gist? Or the source code/build to look at?

---

<div class="post-metadata">

**Author:** ![bjd14](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bjd14](https://discuss.elastic.co/u/bjd14)\
**Post date:** [October 24, 2017, 1:59pm UTC](https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107/3 "2017-10-24T13:59:57Z")

</div>

So I found where its causing the problem. I believe no matter what version is given, the project always wants to use 2.4.4, jest goes down to 2.0.4 as well. I am currently building my own jar that is being compiled via Gradle in a new project.

in Gradle I am using  
compile group: "xxx", name: "elastic-search", version: "0.28.0"

```
     +--- io.searchbox:jest:5.3.2 -> 2.0.4 (*)
| +--- org.elasticsearch:elasticsearch:5.4.2 -> 2.4.4
| | +--- org.apache.lucene:lucene-core:5.5.2
| | +--- org.apache.lucene:lucene-backward-codecs:5.5.2
| | | \--- org.apache.lucene:lucene-core:5.5.2
| | +--- org.apache.lucene:lucene-analyzers-common:5.5.2
| | | \--- org.apache.lucene:lucene-core:5.5.2
| | +--- org.apache.lucene:lucene-queries:5.5.2
| | | \--- org.apache.lucene:lucene-core:5.5.2
| | +--- org.apache.lucene:lucene-memory:5.5.2
| | | \--- org.apache.lucene:lucene-core:5.5.2
| | +--- org.apache.lucene:lucene-highlighter:5.5.2
| | | +--- org.apache.lucene:lucene-analyzers-common:5.5.2 (*)
| | | +--- org.apache.lucene:lucene-core:5.5.2
| | | +--- org.apache.lucene:lucene-join:5.5.2
| | | | +--- org.apache.lucene:lucene-core:5.5.2
| | | | \--- org.apache.lucene:lucene-grouping:5.5.2
| | | +--- org.apache.lucene:lucene-memory:5.5.2 (*)
| | | \--- org.apache.lucene:lucene-queries:5.5.2 (*)
| | +--- org.apache.lucene:lucene-queryparser:5.5.2
| | | +--- org.apache.lucene:lucene-core:5.5.2
| | | +--- org.apache.lucene:lucene-queries:5.5.2 (*)
| | | \--- org.apache.lucene:lucene-sandbox:5.5.2
| | +--- org.apache.lucene:lucene-suggest:5.5.2
| | | +--- org.apache.lucene:lucene-analyzers-common:5.5.2 (*)
| | | +--- org.apache.lucene:lucene-core:5.5.2
| | | +--- org.apache.lucene:lucene-misc:5.5.2
| | | \--- org.apache.lucene:lucene-queries:5.5.2 (*)
| | +--- org.apache.lucene:lucene-join:5.5.2 (*)
| | +--- org.apache.lucene:lucene-spatial:5.5.2
| | | +--- org.apache.lucene:lucene-core:5.5.2
| | | +--- org.apache.lucene:lucene-misc:5.5.2
| | | +--- org.apache.lucene:lucene-queries:5.5.2 (*)
| | | +--- org.apache.lucene:lucene-spatial3d:5.5.2
| | | \--- com.spatial4j:spatial4j:0.5
| | +--- com.google.guava:guava:18.0
| | +--- org.elasticsearch:securesm:1.0
| | +--- com.carrotsearch:hppc:0.7.1
| | +--- joda-time:joda-time:2.9.5 -> 2.9.7
| | +--- com.fasterxml.jackson.core:jackson-core:2.8.1 -> 2.7.3
| | +--- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.1 -> 2.8.7
| | | \--- com.fasterxml.jackson.core:jackson-core:2.8.7 -> 2.7.3
| | +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.1 -> 2.8.7
| | | +--- com.fasterxml.jackson.core:jackson-core:2.8.7 -> 2.7.3
| | | \--- org.yaml:snakeyaml:1.17
| | +--- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.1 -> 2.8.7 (*)
| | +--- org.yaml:snakeyaml:1.15 -> 1.17
| | +--- io.netty:netty:3.10.6.Final
| | +--- com.ning:compress-lzf:1.0.2
| | +--- com.tdunning:t-digest:3.0
| | +--- org.hdrhistogram:HdrHistogram:2.1.6 -> 2.1.9
| | +--- commons-cli:commons-cli:1.3.1
| | \--- com.twitter:jsr166e:1.1.0
```

---

<div class="post-metadata">

**Author:** ![bjd14](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bjd14](https://discuss.elastic.co/u/bjd14)\
**Post date:** [October 24, 2017, 2:04pm UTC](https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107/4 "2017-10-24T14:04:44Z")

</div>

Also I should mention I used and installed locally and used `mavenLocal()` in Gradle. When I did this I would get the same problem but for `NestedAggregationBuilder` not the `BoolQueryBuilder`. It seems to be all coming from the same problem though so I don't think it's much different.

Edit Update:  
`+--- org.elasticsearch:elasticsearch:2.3.3 -> 5.4.2 (*)` (the 2.4.4 was getting cached for some reason, 2.3.3 is version currently on)

I have the gradle dependencies correct but there is still a `java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.index.query.BoolQueryBuilder"` when trying to test.

---

<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:** [November 21, 2017, 2:04pm UTC](https://discuss.elastic.co/t/noclassdeffound-upgrading-jest-elastic/104107/5 "2017-11-21T14:04:54Z")

</div>

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