# Dependency Error while using Java High Level Rest Client

**URL:** https://discuss.elastic.co/t/dependency-error-while-using-java-high-level-rest-client/131088
**Category:** Elasticsearch
**Created:** [May 9, 2018, 2:42am UTC](https://discuss.elastic.co/t/dependency-error-while-using-java-high-level-rest-client/131088 "2018-05-09T02:42:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Littlestay](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Littlestay](https://discuss.elastic.co/u/Littlestay)
#### Post date: [May 9, 2018, 2:42am UTC](https://discuss.elastic.co/t/dependency-error-while-using-java-high-level-rest-client/131088/1 "2018-05-09T02:42:32Z")

</div>

Hi,  
I am trying to develop a spring boot based elasticsearch project and I am trying to use Java High Level Rest Client in the same.  
I am initializing the client like this:

> Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/elasticsearch/common/CheckedConsumer

My pom.xml has the following dependencies:

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

---

<div class="post-metadata">

### Author: ![luxiaoxun](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@luxiaoxun](https://discuss.elastic.co/u/luxiaoxun)
#### Post date: [May 9, 2018, 3:37am UTC](https://discuss.elastic.co/t/dependency-error-while-using-java-high-level-rest-client/131088/2 "2018-05-09T03:37:20Z")

</div>

Try add this:

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

---

<div class="post-metadata">

### Author: ![Littlestay](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Littlestay](https://discuss.elastic.co/u/Littlestay)
#### Post date: [May 9, 2018, 3:46am UTC](https://discuss.elastic.co/t/dependency-error-while-using-java-high-level-rest-client/131088/3 "2018-05-09T03:46:40Z")

</div>

Thanks, but still reported the same mistake.

---

<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: [June 6, 2018, 3:46am UTC](https://discuss.elastic.co/t/dependency-error-while-using-java-high-level-rest-client/131088/4 "2018-06-06T03:46:46Z")

</div>

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