# ElasticSearch 8.12.1 with HighLevelRestClient/JavaClient not working

**URL:** https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [February 22, 2024, 1:34pm UTC](https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888 "2024-02-22T13:34:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![frank-montyne](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@frank-montyne](https://discuss.elastic.co/u/frank-montyne)
#### Post date: [February 22, 2024, 1:34pm UTC](https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888/1 "2024-02-22T13:34:23Z")

</div>

I'm trying to use Elasticsearch 8.12.1 with the 7.17.18 HighLevelRestClient and the new 8.12.1 JavaClient.

I saw that for all the org.elasticsearch and org.elasticsearch.client artifacts there are now 8.12.1 versions except for the elasticsearch-rest-high-level-client. Am I supposed to use these versions together with the elasticsearch-rest-high-level-client 7.17.18 version or should I use for all the org.elasticsearch and org.elasticsearch.client artifacts the 7.17.18 versions?

When I use the 7.17.18 versions I get  
java.lang.NoSuchMethodError: 'org.elasticsearch.client.RequestOptions$Builder org.elasticsearch.client.RequestOptions$Builder.setHttpAsyncResponseConsumerFactory(org.elasticsearch.client.HttpAsyncResponseConsumerFactory)'

When I use the 8.12.1 versions there are a lot of changes/omissions in the aggregations. AutoDateHistogramBuilder is not present, movingFuncton and normalize is missing... Even when doing a simple connect I get that the class org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest is not found.

I am a bit desperate at the moment. All help is greatly appreciated.

---

<div class="post-metadata">

### Author: ![frank-montyne](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@frank-montyne](https://discuss.elastic.co/u/frank-montyne)
#### Post date: [February 22, 2024, 2:06pm UTC](https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888/2 "2024-02-22T14:06:35Z")

</div>

Meanwhile after some further investigation I got things to work with an older version of the JavaClient. When I am using the 7.17.18 artifacts for all the org.elasticsearch and org.elasticsearch.client artifacts and the 8.11.4 version for the co.elastic.clients elasticsearch-java artifact I can connect without problems. If I use version 8.12.1 I get java.lang.NoSuchMethodError: 'org.elasticsearch.client.RequestOptions$Builder org.elasticsearch.client.RequestOptions$Builder.setHttpAsyncResponseConsumerFactory(org.elasticsearch.client.HttpAsyncResponseConsumerFactory)'

Should I file a bug or am i doing something wrong?

---

<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: [February 22, 2024, 3:05pm UTC](https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888/3 "2024-02-22T15:05:36Z")

</div>

Have a look at

> <https://github.com/dadoonet/elasticsearch-java-client-demo/blob/main/src/test/java/fr/pilato/test/elasticsearch/hlclient/EsClientIT.java>

It contains a lot of examples.

Here I think you are trying to mix 2 different versions of the same lib.

```
 dependency:tree 

```

Should help to clarify

---

<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: [March 21, 2024, 3:05pm UTC](https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888/4 "2024-03-21T15:05:57Z")

</div>

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