# ES 5 Transport : java.lang.NoSuchMethodError: io.netty.buffer.CompositeByteBuf.addComponents

**URL:** <https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267>\
**Category:** Elasticsearch\
**Created:** [November 7, 2016, 7:42pm UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267 "2016-11-07T19:42:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![quent](https://avatars.discourse-cdn.com/v4/letter/q/e19adc/32.png) [@quent](https://discuss.elastic.co/u/quent)\
**Post date:** [November 7, 2016, 7:42pm UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267/1 "2016-11-07T19:42:23Z")

</div>

Hi everyone,

After fixing the error with log4j as recommended [here](https://discuss.elastic.co/t/issue-with-elastic-search-5-0-0-java-lang-classnotfoundexception-org-apache-logging-log4j-core-async-daemonthreadfactory/64345?u=quent).

I have now the following error:

```
Exception in thread "main" java.lang.NoSuchMethodError: io.netty.buffer.CompositeByteBuf.addComponents(ZLjava/lang/Iterable;)Lio/netty/buffer/CompositeByteBuf;
        at org.elasticsearch.transport.netty4.Netty4Utils.toByteBuf(Netty4Utils.java:75)
        at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:449)
        at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:91)
        at org.elasticsearch.transport.TcpTransport.internalSendMessage(TcpTransport.java:947)
        at org.elasticsearch.transport.TcpTransport.sendRequest(TcpTransport.java:929)
        at org.elasticsearch.transport.TransportService.sendRequestInternal(TransportService.java:493)
        at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:459)
        at org.elasticsearch.transport.TransportService.submitRequest(TransportService.java:445)
        at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:388)
        at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:324)
        at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:191)
        at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:282)
        at sonar.db.elasticsearch.ElasticSearchIndexCreator.createIndex(ElasticSearchIndexCreator.java:33)

```

Thank you.

---

<div class="post-metadata">

**Author:** ![quent](https://avatars.discourse-cdn.com/v4/letter/q/e19adc/32.png) [@quent](https://discuss.elastic.co/u/quent)\
**Post date:** [November 7, 2016, 9:06pm UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267/2 "2016-11-07T21:06:41Z")

</div>

Fixed. Problems was caused by others dependencies in my project.

---

<div class="post-metadata">

**Author:** ![wxx520](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@wxx520](https://discuss.elastic.co/u/wxx520)\
**Post date:** [November 8, 2016, 8:55am UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267/3 "2016-11-08T08:55:22Z")

</div>

Could you tell me how do you solve this problem?I have recently been learning the ES. AND I also met you meet problem

---

<div class="post-metadata">

**Author:** ![quent](https://avatars.discourse-cdn.com/v4/letter/q/e19adc/32.png) [@quent](https://discuss.elastic.co/u/quent)\
**Post date:** [November 8, 2016, 3:44pm UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267/4 "2016-11-08T15:44:59Z")

</div>

Hey @wxx520,  
This problem is caused by concurrent versions of Netty being used by different dependencies in your project.  
Basically, ES 5 Transport API required Netty 4. And Dependency X, still use Netty 3. This can cause this problem.

What I tried:

1. Add Netty 4 as dependecy in my project -\> Didn't work.
2. Create an independant project for my use of ES 5 Transport Client -\> It worked.

My use of the Transport client was only to create an index and the mapping. Documents are stored with the elasticsearch spark connector.

I would advise you to try 1. And then if it does not work try 2.

---

<div class="post-metadata">

**Author:** ![wxx520](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@wxx520](https://discuss.elastic.co/u/wxx520)\
**Post date:** [November 9, 2016, 3:14am UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267/5 "2016-11-09T03:14:06Z")

</div>

Hi,@Quent!  
Thank you very much for your advice!The problem I encountered really was caused by a Netty version conflict.And I have solved it by trying 1.  
My use of the Transport client is to play a role similar to the postman by java code .  
And I has completed bulk index and update by Transport client. Next step is to the mapping.If i  
My English is not very good.Nonetheless be glad to talk to you!

---

<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:** [December 7, 2016, 3:14am UTC](https://discuss.elastic.co/t/es-5-transport-java-lang-nosuchmethoderror-io-netty-buffer-compositebytebuf-addcomponents/65267/6 "2016-12-07T03:14:06Z")

</div>

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