# java.lang.NoSuchMethodError exception observed when indexing data in elasticsearch v5.2.2

**URL:** <https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715>\
**Category:** Elasticsearch\
**Created:** [March 23, 2017, 9:12am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715 "2017-03-23T09:12:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kishore419](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kishore419](https://discuss.elastic.co/u/kishore419)\
**Post date:** [March 23, 2017, 9:12am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715/1 "2017-03-23T09:12:08Z")

</div>

Upgraded standalone elasticsearch software from v2.1.0 to v5.2.2  
can any one share solution for the below issue?

Exception in thread "elasticsearch[_client_][management][T#1]" java.lang.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)  
at org.elasticsearch.transport.TcpTransport.executeHandshake(TcpTransport.java:1555)  
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:502)  
at org.elasticsearch.transport.TcpTransport.connectToNode(TcpTransport.java:460)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:318)  
at org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1.run(TransportClientNodesService.java:488)  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:527)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)

---

<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:** [March 23, 2017, 3:34pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715/2 "2017-03-23T15:34:56Z")

</div>

I think that you have a dependency mismatch, are you sure that you pulled everything in correctly? You should see Netty 4.1.7 dependencies on your classpath, anything else is wrong.

---

<div class="post-metadata">

**Author:** ![kishore419](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kishore419](https://discuss.elastic.co/u/kishore419)\
**Post date:** [March 24, 2017, 9:41am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715/3 "2017-03-24T09:41:36Z")

</div>

i have used following dependency packages but still receiving the same issues.  
  
org.elasticsearch.plugin  
transport-netty4-client  
5.2.2  
jar  
  
  
com.lmax  
disruptor  
3.3.6

Netty 4.1.7 dependencies are not found.

---

<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:** [March 25, 2017, 12:54am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715/4 "2017-03-25T00:54:06Z")

</div>

You should use `org.elasticsearch.client:transport:5.2.2` instead of `org.elasticsearch.plugin:transport-netty4-client:5.2.2`. It's easier to use, and includes the dependencies that you need (as long as you're pulling in transitive dependencies).

---

<div class="post-metadata">

**Author:** ![kishore419](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kishore419](https://discuss.elastic.co/u/kishore419)\
**Post date:** [April 7, 2017, 8:48am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715/5 "2017-04-07T08:48:45Z")

</div>

i have used org.elasticsearch.client:transport:5.2.2 API and errors got resolved.  
But new issue was observed.  
i.e. i am using spark 1.5.1 dependency API to insert data into elasticsearch v5.2.2.  
netty version mismatch was observed [w.r.to](http://w.r.to) spark & elasticsearch  
excluded netty all 4.x package and issue got resolved.

---

<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:** [May 5, 2017, 9:01am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-exception-observed-when-indexing-data-in-elasticsearch-v5-2-2/79715/6 "2017-05-05T09:01:44Z")

</div>

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