# java.lang.NoSuchMethodError: org.elasticsearch.action.index.IndexRequest.ifSeqNo()J

**URL:** https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881
**Category:** Elasticsearch
**Created:** [April 15, 2019, 10:22am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881 "2019-04-15T10:22:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Zyuxing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zyuxing/32/44143_2.png) [@Zyuxing](https://discuss.elastic.co/u/Zyuxing)
#### Post date: [April 15, 2019, 10:22am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881/1 "2019-04-15T10:22:05Z")

</div>

在我使用elasticsearch-rest-high-level-client7.0版本连接elasticsearch7.0的时候使用官网提供的示例：  
IndexRequest indexRequest = new IndexRequest("pubmed2","\_doc","2").source(jsonMap);  
var indexResponse = restHighLevelClient.index(indexRequest, RequestOptions.DEFAULT);  
他发生java.lang.NoSuchMethodError: org.elasticsearch.action.index.IndexRequest.ifSeqNo()J错误，  
模板已经建好：  
{  
"mapping": {  
"properties": {  
"id": {  
"type": "integer"  
}  
}  
}  
}

---

<div class="post-metadata">

### Author: ![deepakn42](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deepakn42](https://discuss.elastic.co/u/deepakn42)
#### Post date: [April 28, 2019, 9:06am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881/3 "2019-04-28T09:06:08Z")

</div>

If using any dependency tool follow below steps:

1. Exclude "groupd Id: org.elasticsearch artifactId:elasticsearch ", "groupId: org.elasticsearch.client artifactId:elasticsearch-rest-client " from elasticsearch-rest-high-level-client(as it loads 6.4.3 version of these jars)

2. Add dependencies for above two excluded jars with verion 7.0.0 and build.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 28, 2019, 9:17am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881/4 "2019-04-28T09:17:20Z")

</div>

Are you using spring boot?

---

<div class="post-metadata">

### Author: ![deepakn42](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deepakn42](https://discuss.elastic.co/u/deepakn42)
#### Post date: [April 28, 2019, 9:38am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881/5 "2019-04-28T09:38:24Z")

</div>

Yes I had this issue with Spring boot.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 28, 2019, 12:18pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881/6 "2019-04-28T12:18:17Z")

</div>

Next time, provide more context. That will help to get a faster answer.

When using springboot with  
elasticsearch, you need to be explicit with some transitive dependencies as SpringBoot declares a version 6.4...

Basically you can put this in your `pom.xml`:

```auto
<properties>
  <elasticsearch.version>7.0.0<elasticsearch.version>
</properties>

```

See documentation here: [https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-customize-dependency-versions](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-customize-dependency-versions)

---

<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 26, 2019, 12:18pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-action-index-indexrequest-ifseqno-j/176881/7 "2019-05-26T12:18:28Z")

</div>

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