# Java API Client Conflict? java.lang.NoSuchMethodError: org.elasticsearch.client.RequestOptions$Builder.setHttpAsyncResponseConsumerFactory

**URL:** https://discuss.elastic.co/t/java-api-client-conflict-java-lang-nosuchmethoderror-org-elasticsearch-client-requestoptions-builder-sethttpasyncresponseconsumerfactory/363367
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [July 18, 2024, 4:55pm UTC](https://discuss.elastic.co/t/java-api-client-conflict-java-lang-nosuchmethoderror-org-elasticsearch-client-requestoptions-builder-sethttpasyncresponseconsumerfactory/363367 "2024-07-18T16:55:29Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)
#### Post date: [July 19, 2024, 9:22am UTC](https://discuss.elastic.co/t/java-api-client-conflict-java-lang-nosuchmethoderror-org-elasticsearch-client-requestoptions-builder-sethttpasyncresponseconsumerfactory/363367/2 "2024-07-19T09:22:08Z")

</div>

Hello!  
I have created a minimal project using the pom and code provided, and I didn't manage to reproduce the error - with only the two elasticsearch dependencies + jackson + the spring bom everything works fine.

`SafeResponseConsumer` is a class in found in version 8 of the client which extends `HttpAsyncResponseConsumer` from apache httpcore-nio, I suspect there could be some dependency clashing with other imported libraries (spring security for example) that resolves to the project using a non compatible version of the apache library.

I suggest following the [guide](https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888/2) provided in the old thread, because the problem seems to be similar.

---

_[View the full topic](https://discuss.elastic.co/t/java-api-client-conflict-java-lang-nosuchmethoderror-org-elasticsearch-client-requestoptions-builder-sethttpasyncresponseconsumerfactory/363367)._
