# Issue with High Level Rest Client Api

**URL:** https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853
**Category:** Elasticsearch
**Created:** [August 20, 2019, 6:34am UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853 "2019-08-20T06:34:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![shantanu\_bhardwaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shantanu_bhardwaj/32/52241_2.png) [@shantanu\_bhardwaj](https://discuss.elastic.co/u/shantanu_bhardwaj)
#### Post date: [August 20, 2019, 6:34am UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/1 "2019-08-20T06:34:50Z")

</div>

```
    RestHighLevelClient restHighLevelClient = new RestHighLevelClient(RestClient.builder(new HttpHost("localhost", 9200)));
    CreateIndexRequest indexRequest = new CreateIndexRequest("sample-index");
     restHighLevelClient.indices().create(indexRequest,RequestOptions.DEFAULT); 

    <dependency>
    			<groupId>org.elasticsearch.client</groupId>
    			<artifactId>elasticsearch-rest-high-level-client</artifactId>
    			<version>7.3.0</version>
    		</dependency>

```

Logs

```
    java.lang.NoSuchMethodError: org.elasticsearch.client.Request.addParameters(Ljava/util/Map;)V
    	at org.elasticsearch.client.IndicesRequestConverters.createIndex(IndicesRequestConverters.java:128) ~[elasticsearch-rest-high-level-client-7.3.0.jar:6.4.3]
    	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1450) ~[elasticsearch-rest-high-level-client-7.3.0.jar:6.4.3]
    	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1424) ~[elasticsearch-rest-high-level-client-7.3.0.jar:6.4.3]
```

---

<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: [August 20, 2019, 6:46am UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/2 "2019-08-20T06:46:56Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

Are you using SpringBoot by any chance ? What does your full pom.xml look like?

---

<div class="post-metadata">

### Author: ![shantanu\_bhardwaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shantanu_bhardwaj/32/52241_2.png) [@shantanu\_bhardwaj](https://discuss.elastic.co/u/shantanu_bhardwaj)
#### Post date: [August 20, 2019, 6:54am UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/3 "2019-08-20T06:54:59Z")

</div>

yes, I am using spring -boot ,with the dependency of

```
<dependency>
    			<groupId>org.elasticsearch.client</groupId>
    			<artifactId>elasticsearch-rest-high-level-client</artifactId>
    			<version>7.3.0</version>
    		</dependency>
```

---

<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: [August 20, 2019, 7:06am UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/4 "2019-08-20T07:06:28Z")

</div>

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.3.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: ![shantanu\_bhardwaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shantanu_bhardwaj/32/52241_2.png) [@shantanu\_bhardwaj](https://discuss.elastic.co/u/shantanu_bhardwaj)
#### Post date: [August 20, 2019, 7:32am UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/5 "2019-08-20T07:32:05Z")

</div>

Thank you, its working now.

---

<div class="post-metadata">

### Author: ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)
#### Post date: [August 27, 2019, 12:39pm UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/6 "2019-08-27T12:39:35Z")

</div>

Nice to now.  
But what if I am using the spring boot starter in import scope and not as parent?

---

<div class="post-metadata">

### Author: ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)
#### Post date: [August 27, 2019, 12:47pm UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/7 "2019-08-27T12:47:35Z")

</div>

So the solution for maven projects that don't use spring as parant project.

```
 <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>${version.elasticsearch}</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-client</artifactId>
        <version>${version.elasticsearch}</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>${version.elasticsearch}</version>
    </dependency>
```

---

<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: [September 24, 2019, 12:47pm UTC](https://discuss.elastic.co/t/issue-with-high-level-rest-client-api/195853/8 "2019-09-24T12:47:42Z")

</div>

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