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

Hi everyone,

After fixing the error with log4j as recommended here.

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(
        at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(
        at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(
        at org.elasticsearch.transport.TcpTransport.internalSendMessage(
        at org.elasticsearch.transport.TcpTransport.sendRequest(
        at org.elasticsearch.transport.TransportService.sendRequestInternal(
        at org.elasticsearch.transport.TransportService.sendRequest(
        at org.elasticsearch.transport.TransportService.submitRequest(
        at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(
        at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(
        at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(
        at org.elasticsearch.client.transport.TransportClient.addTransportAddress(
        at sonar.db.elasticsearch.ElasticSearchIndexCreator.createIndex(

Thank you.

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

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

1 Like

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.

1 Like

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!

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