NoClassDefFound Upgrading Jest & Elastic

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?

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

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

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.

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