# Upgrade to Elastic version 5.6.12 causes exception

**URL:** <https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409>\
**Category:** Elasticsearch\
**Created:** [December 11, 2018, 4:19pm UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409 "2018-12-11T16:19:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![trabakoulas](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@trabakoulas](https://discuss.elastic.co/u/trabakoulas)\
**Post date:** [December 11, 2018, 4:19pm UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/1 "2018-12-11T16:19:20Z")

</div>

Hello,

I'm trying to upgrade my ElasticSearch from 2.3.4 to 5.6.12. In order to create my Client, due to this upgrade, I use now the PreBuiltTransportClient instead of the TransportClient.

During the runtime I get the following exception:

Exception in thread "main" java.lang.NoSuchMethodError: io.netty.util.internal.ObjectUtil.checkPositive(ILjava/lang/String;)I"}  
io.netty.util.NettyRuntime$AvailableProcessorsHolder.setAvailableProcessors(NettyRuntime.java:44)"}  
io.netty.util.NettyRuntime.setAvailableProcessors(NettyRuntime.java:87)"}  
org.elasticsearch.transport.netty4.Netty4Utils.setAvailableProcessors(Netty4Utils.java:85)"}  
org.elasticsearch.transport.netty4.Netty4Transport.(Netty4Transport.java:140)"}  
org.elasticsearch.transport.Netty4Plugin.lambda$getTransports$0(Netty4Plugin.java:93)"}  
org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:177)"}  
org.elasticsearch.client.transport.TransportClient.(TransportClient.java:268)"}  
org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:133)"}  
org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:119)"}  
org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:109)"}

I added in my pom.xml file the dependency for netty 4.1.13 which has the missing method but with no luck:

 io.netty netty-all 4.1.13.Final 

Could you please help me on this?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 12, 2018, 12:48pm UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/2 "2018-12-12T12:48:50Z")

</div>

is it possible, that you still have an older netty version in your list of dependencies that gets loaded?

---

<div class="post-metadata">

**Author:** ![trabakoulas](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@trabakoulas](https://discuss.elastic.co/u/trabakoulas)\
**Post date:** [December 12, 2018, 1:09pm UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/3 "2018-12-12T13:09:32Z")

</div>

I added exlusion for netty in every depedency that gets loaded in my pom.xml file. This should be enough. Correct?  
The problem was not fixed. I also added "System.setProperty("es.set.netty.runtime.available.processors", "false");" before I initialize my Client and now I get in the runtime the following exception:

:"Exception in thread "elasticsearch[_client_][management][T#1]" java.lang.NoSuchMethodError: io.netty.buffer.CompositeByteBuf.addComponents(ZLjava/lang/Iterable;)Lio/netty/buffer/CompositeByteBuf;"}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 12, 2018, 2:58pm UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/4 "2018-12-12T14:58:22Z")

</div>

which netty version do you see when running `mvn dependency:tree`?

---

<div class="post-metadata">

**Author:** ![trabakoulas](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@trabakoulas](https://discuss.elastic.co/u/trabakoulas)\
**Post date:** [December 12, 2018, 3:25pm UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/5 "2018-12-12T15:25:33Z")

</div>

Please see below the result of the mvn dependency:tree:

[INFO] +- org.elasticsearch:elasticsearch:jar:5.6.12:compile  
[INFO] | +- org.apache.lucene:lucene-core:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-backward-codecs:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-grouping:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-highlighter:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-join:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-memory:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-misc:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-queries:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-queryparser:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-sandbox:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-spatial:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-spatial-extras:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-spatial3d:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-suggest:jar:6.6.1:compile  
[INFO] | +- org.elasticsearch:securesm:jar:1.2:compile  
[INFO] | +- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile  
[INFO] | +- com.carrotsearch:hppc:jar:0.7.1:compile  
[INFO] | +- joda-time:joda-time:jar:2.9.5:compile  
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile  
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.6:compile  
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.6:compile  
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.6:compile  
[INFO] | +- com.tdunning:t-digest:jar:3.0:compile  
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile  
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.11.1:compile  
[INFO] | - org.elasticsearch:jna:jar:4.4.0-1:compile  
[INFO] +- org.elasticsearch.client:transport:jar:5.6.12:compile  
[INFO] | +- org.elasticsearch.plugin:transport-netty3-client:jar:5.6.12:compile  
[INFO] | | +- org.locationtech.spatial4j:spatial4j:jar:0.6:compile  
[INFO] | | +- com.vividsolutions:jts:jar:1.13:compile  
[INFO] | | - org.apache.logging.log4j:log4j-core:jar:2.11.1:compile  
[INFO] | +- org.elasticsearch.plugin:transport-netty4-client:jar:5.6.12:compile  
[INFO] | | +- io.netty:netty-buffer:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-codec:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-common:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-handler:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-resolver:jar:4.1.13.Final:compile  
[INFO] | | - io.netty:netty-transport:jar:4.1.13.Final:compile  
[INFO] | +- org.elasticsearch.plugin:reindex-client:jar:5.6.12:compile  
[INFO] | | - org.elasticsearch.client:elasticsearch-rest-client:jar:5.6.12:compile  
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile  
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile  
[INFO] | | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.2:compile  
[INFO] | | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.5:compile  
[INFO] | | - commons-logging:commons-logging:jar:1.1.3:compile  
[INFO] | +- org.elasticsearch.plugin:lang-mustache-client:jar:5.6.12:compile  
[INFO] | | - com.github.spullara.mustache.java:compiler:jar:0.9.3:compile  
[INFO] | +- org.elasticsearch.plugin:percolator-client:jar:5.6.12:compile  
[INFO] | - org.elasticsearch.plugin:parent-join-client:jar:5.6.12:compile

I still get the following exception:

"Exception in thread "elasticsearch[_client_][management][T#1]" java.lang.NoSuchMethodError: io.netty.buffer.CompositeByteBuf.addComponents(ZLjava/lang/Iterable;)Lio/netty/buffer/CompositeByteBuf;"}  
org.elasticsearch.transport.netty4.Netty4Utils.toByteBuf(Netty4Utils.java:120)"}  
org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:400)"}  
org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:96)"}  
org.elasticsearch.transport.TcpTransport.internalSendMessage(TcpTransport.java:1138)"}  
org.elasticsearch.transport.TcpTransport.sendRequestToChannel(TcpTransport.java:1124)"}  
org.elasticsearch.transport.TcpTransport.executeHandshake(TcpTransport.java:1623)"}  
org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:577)"}  
org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:117)"}  
org.elasticsearch.transport.TransportService.openConnection(TransportService.java:361)"}  
org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1.doRun(TransportClientNodesService.java:506)"}  
org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:675)"}  
org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)"}  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)"}  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)"}

Thank you very much for the help.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 13, 2018, 8:27am UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/6 "2018-12-13T08:27:09Z")

</div>

there seem to be two transport client dependencies, one for netty3 and one for netty4

```auto
org.elasticsearch.plugin:transport-netty3-client

org.elasticsearch.plugin:transport-netty4-client

```

can you only use the netty4 one?

---

<div class="post-metadata">

**Author:** ![trabakoulas](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@trabakoulas](https://discuss.elastic.co/u/trabakoulas)\
**Post date:** [December 13, 2018, 8:34am UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/7 "2018-12-13T08:34:20Z")

</div>

Thanks for the answer.

Could you please let me know how to do it?

The only thing I do regarding the transport client dependency is to add the following in the pom.xml file:

"\< dependency\>  
\< groupId\>org.elasticsearch.client  
\< artifactId\>transport  
\< version\>5.6.12  
\< exclusions\>  
  
io.netty  
netty-all  
\< /exclusion\>  
\< /exclusions\>  
\< /dependency\>"

How can I exclude the netty3?

I have also found the folowing. Seems a similar issue:

> [@Netty dependency issue with ElasticSearch 5.4](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/5):
>
> This is not a problem, Netty 3 and Netty 4 use completely different package names so there is no possibility of conflict.

---

<div class="post-metadata">

**Author:** ![trabakoulas](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@trabakoulas](https://discuss.elastic.co/u/trabakoulas)\
**Post date:** [December 13, 2018, 11:15am UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/8 "2018-12-13T11:15:22Z")

</div>

I managed to remove org.elasticsearch.plugin:transport-netty3-client 9from mvn dependency:tree):

[INFO] +- org.elasticsearch:elasticsearch:jar:5.6.12:compile  
[INFO] | +- org.apache.lucene:lucene-core:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-backward-codecs:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-grouping:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-highlighter:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-join:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-memory:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-misc:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-queries:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-queryparser:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-sandbox:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-spatial:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-spatial-extras:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-spatial3d:jar:6.6.1:compile  
[INFO] | +- org.apache.lucene:lucene-suggest:jar:6.6.1:compile  
[INFO] | +- org.elasticsearch:securesm:jar:1.2:compile  
[INFO] | +- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile  
[INFO] | +- com.carrotsearch:hppc:jar:0.7.1:compile  
[INFO] | +- joda-time:joda-time:jar:2.9.5:compile  
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile  
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.6:compile  
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.6:compile  
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.6:compile  
[INFO] | +- com.tdunning:t-digest:jar:3.0:compile  
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile  
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.11.1:compile  
[INFO] | - org.elasticsearch:jna:jar:4.4.0-1:compile  
[INFO] +- org.elasticsearch.client:transport:jar:5.6.12:compile  
[INFO] | +- org.elasticsearch.plugin:transport-netty4-client:jar:5.6.12:compile  
[INFO] | | +- io.netty:netty-buffer:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-codec:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-common:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-handler:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-resolver:jar:4.1.13.Final:compile  
[INFO] | | +- io.netty:netty-transport:jar:4.1.13.Final:compile  
[INFO] | | +- org.locationtech.spatial4j:spatial4j:jar:0.6:compile  
[INFO] | | +- com.vividsolutions:jts:jar:1.13:compile  
[INFO] | | - org.apache.logging.log4j:log4j-core:jar:2.11.1:compile  
[INFO] | +- org.elasticsearch.plugin:reindex-client:jar:5.6.12:compile  
[INFO] | | - org.elasticsearch.client:elasticsearch-rest-client:jar:5.6.12:compile  
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile  
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile  
[INFO] | | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.2:compile  
[INFO] | | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.5:compile  
[INFO] | | - commons-logging:commons-logging:jar:1.1.3:compile  
[INFO] | +- org.elasticsearch.plugin:lang-mustache-client:jar:5.6.12:compile  
[INFO] | | - com.github.spullara.mustache.java:compiler:jar:0.9.3:compile  
[INFO] | +- org.elasticsearch.plugin:percolator-client:jar:5.6.12:compile  
[INFO] | - org.elasticsearch.plugin:parent-join-client:jar:5.6.12:compile  
[INFO] +- io.netty:netty-all:jar:4.1.25.Final:compile

Now I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/transport/Netty3Plugin"}  
org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:91)"}  
com.nokia.ntas.api.es.ESActiveAlarmDB.createClient(ESActiveAlarmDB.java:105)"}  
com.nokia.ntas.api.es.ESActiveAlarmDB.(ESActiveAlarmDB.java:72)"}  
com.nokia.mme.ts.EventConsumer.main(EventConsumer.java:109)"}  
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"}  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"}  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"}  
java.lang.reflect.Method.invoke(Method.java:498)"}  
org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)"}  
org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)"}  
org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)"}  
org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)"}  
org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)"}  
"Caused by: java.lang.ClassNotFoundException: org.elasticsearch.transport.Netty3Plugin"}  
java.net.URLClassLoader.findClass(URLClassLoader.java:382)"}  
java.lang.ClassLoader.loadClass(ClassLoader.java:424)"}  
java.lang.ClassLoader.loadClass(ClassLoader.java:357)"}

Btw I have added in my pom.xml the following dependency with no result:

\< dependency\>  
\< groupId\>org.elasticsearch.plugin  
transport-netty4-client  
\< version\>${elastic.version}  
\< /dependency\>

---

<div class="post-metadata">

**Author:** ![trabakoulas](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@trabakoulas](https://discuss.elastic.co/u/trabakoulas)\
**Post date:** [December 18, 2018, 9:56am UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/9 "2018-12-18T09:56:28Z")

</div>

Hi Alex,

Could you please help me with this?

---

<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 15, 2019, 9:56am UTC](https://discuss.elastic.co/t/upgrade-to-elastic-version-5-6-12-causes-exception/160409/10 "2019-01-15T09:56:31Z")

</div>

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