# Netty dependency issue with ElasticSearch 5.4

**URL:** <https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120>\
**Category:** Elasticsearch\
**Created:** [June 12, 2017, 10:08pm UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120 "2017-06-12T22:08:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gargdeepak](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@gargdeepak](https://discuss.elastic.co/u/gargdeepak)\
**Post date:** [June 12, 2017, 10:08pm UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/1 "2017-06-12T22:08:48Z")

</div>

Hi,  
I'm running ES 5.4.1 with the transport client library. I'm running into a dependency issue and below is the error:  
(Netty4Utils:117)-NoSuchMethodError io.netty.buffer.CompositeByteBuf.addComponents(ZLjava/lang/Iterable;)Lio/netty/buffer/CompositeByteBuf;  
at org.elasticsearch.transport.netty4.Netty4Utils.toByteBuf(Netty4Utils.java:78)  
at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:422)  
at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:93)  
at org.elasticsearch.transport.TcpTransport.internalSendMessage(TcpTransport.java:1058)  
at org.elasticsearch.transport.TcpTransport.sendRequestToChannel(TcpTransport.java:1040)

I did a mvn dependency tree and found the ES depends on both Netty3 and Netty4. I tried to exclude one but to no avail as ES needed the dependency. Does anyone know what's the way around it ?

Thanks !

---

<div class="post-metadata">

**Author:** ![Alex\_Davidovich](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Alex\_Davidovich](https://discuss.elastic.co/u/Alex_Davidovich)\
**Post date:** [June 13, 2017, 8:01am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/2 "2017-06-13T08:01:14Z")

</div>

> [@gargdeepak](#):
>
> did a mvn dependency tree and found the ES depends on both Netty3 and Netty4. I tried to exclude one but to no avail as ES needed the dependency. Does anyone know what's the way around it ?

I had a similar problem and in my case, I used non-matched dependencies:  
  
org.elasticsearch  
elasticsearch  
5.4.1  
  
  
org.elasticsearch.client  
transport  
5.4.0

The fix was to use org.elasticsearch.client 5.4.1

---

<div class="post-metadata">

**Author:** ![gargdeepak](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@gargdeepak](https://discuss.elastic.co/u/gargdeepak)\
**Post date:** [June 13, 2017, 9:46pm UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/3 "2017-06-13T21:46:50Z")

</div>

I have the same versions of ES i.e. 5.4.1

---

<div class="post-metadata">

**Author:** ![Manish\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@Manish\_Agarwal](https://discuss.elastic.co/u/Manish_Agarwal)\
**Post date:** [June 15, 2017, 6:16pm UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/4 "2017-06-15T18:16:00Z")

</div>

I am running in the same issue. Can someone please help?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [June 16, 2017, 2:40am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/5 "2017-06-16T02:40:32Z")

</div>

> [@gargdeepak](#):
>
> I did a mvn dependency tree and found the ES depends on both Netty3 and Netty4.

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:** ![Manish\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@Manish\_Agarwal](https://discuss.elastic.co/u/Manish_Agarwal)\
**Post date:** [June 16, 2017, 2:52am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/6 "2017-06-16T02:52:16Z")

</div>

Thanks for the response jason. Do you have any idea what else could cause that exception?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [June 16, 2017, 3:07am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/7 "2017-06-16T03:07:43Z")

</div>

I think that you have an older version of Netty 4 on your classpath (maybe you accidentally included 4.0.11.Final or you have another dependency that depends on an older version of 4.0.x.Final of Netty? I say this because that method (`io.netty.buffer.CompositeByteBuf io.netty.buffer.CompositeByteBuf#addComponents(boolean, java.lang.Iterable)`) has existed through the life of the 4.1.x.Final series of Netty but not always in 4.0.x.Final. If you have an older 4.0.x.Final on the classpath then you can see exactly this error. Double check your dependencies and ensure that you have the right version and not a second version (explicitly or transitively).

---

<div class="post-metadata">

**Author:** ![gargdeepak](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@gargdeepak](https://discuss.elastic.co/u/gargdeepak)\
**Post date:** [June 20, 2017, 12:24am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/8 "2017-06-20T00:24:28Z")

</div>

These are all the netty jars in the classpath of my project.

find lib/ -iname "_netty_"  
lib/netty-buffer-4.1.11.Final.jar  
lib/netty-common-4.1.11.Final.jar  
lib/netty-handler-4.1.11.Final.jar  
lib/netty-codec-4.1.11.Final.jar  
lib/netty-3.10.6.Final.jar  
lib/netty-resolver-4.1.11.Final.jar  
lib/transport-netty3-client-5.4.1.jar  
lib/netty-codec-http-4.1.11.Final.jar  
lib/transport-netty4-client-5.4.1.jar  
lib/netty-transport-4.1.11.Final.jar

both versions were brought in by ElasticSearch itself. I don't have any explicit dependency on netty.

---

<div class="post-metadata">

**Author:** ![luyee2010](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@luyee2010](https://discuss.elastic.co/u/luyee2010)\
**Post date:** [July 7, 2017, 5:39am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/9 "2017-07-07T05:39:34Z")

</div>

try setting

.put("transport.type","netty3")  
.put("http.type", "netty3")

---

<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:** [August 4, 2017, 5:39am UTC](https://discuss.elastic.co/t/netty-dependency-issue-with-elasticsearch-5-4/89120/10 "2017-08-04T05:39:52Z")

</div>

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