elastic / elasticsearch-java

Official Elasticsearch Java Client
Apache License 2.0
408 stars 237 forks source link

ElasticSearch 8.12.1 with HighLevelRestClient/JavaClient combination not working #752

Closed frank-montyne closed 6 months ago

frank-montyne commented 6 months ago

Java API client version

8.12.1

Java version

21

Elasticsearch Version

8.12.1

Problem description

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

I am using the 7.17.18 artifacts for all the org.elasticsearch and org.elasticsearch.client artifacts and the 8.12.1 version for the co.elastic.clients elasticsearch-java artifact.

When I try to connect I get the following error:

java.lang.NoSuchMethodError: 'org.elasticsearch.client.RequestOptions$Builder org.elasticsearch.client.RequestOptions$Builder.setHttpAsyncResponseConsumerFactory(org.elasticsearch.client.HttpAsyncResponseConsumerFactory)'
    at co.elastic.clients.transport.rest_client.SafeResponseConsumer.<clinit>(SafeResponseConsumer.java:52)
    at co.elastic.clients.transport.rest_client.RestClientOptions.initialOptions(RestClientOptions.java:191)
    at co.elastic.clients.transport.rest_client.RestClientOptions.of(RestClientOptions.java:52)
    at co.elastic.clients.transport.rest_client.RestClientHttpClient.createOptions(RestClientHttpClient.java:84)
    at co.elastic.clients.transport.rest_client.RestClientHttpClient.createOptions(RestClientHttpClient.java:48)
    at co.elastic.clients.transport.ElasticsearchTransportBase.<init>(ElasticsearchTransportBase.java:109)
    at co.elastic.clients.transport.rest_client.RestClientTransport.<init>(RestClientTransport.java:36)
    at co.elastic.clients.transport.rest_client.RestClientTransport.<init>(RestClientTransport.java:32)
    at com.bynubian.elasticsearch.ByNeuronElasticSearch.connect(ByNeuronElasticSearch.java:191)
        ...

When I downgrade for the JavaClient to 8.11.4 I can connect without any problem. All 8.12.x versions produce the NoSuchMethodError

Am i doing something wrong?

I also 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? I tried that out but 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 an error stating that the class org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest is not found. Is this a work in progress?

All help is welcome

t19980620 commented 6 months ago

I also encountered the same problem

l-trotta commented 6 months ago

Hello, thank you for the report!

Discuss thread for reference

I saw in the thread that @dadoonet proposed a course of inquiry, could you please tell me what the result of that was?

frank-montyne commented 6 months ago

The problem was solved in 8.12.2.

Thanks for the follow-up

On Wed, Feb 28, 2024 at 6:38 PM Laura Trotta @.***> wrote:

Hello, thank you for the report!

Discuss thread for reference https://discuss.elastic.co/t/elasticsearch-8-12-1-with-highlevelrestclient-javaclient-not-working/353888

I saw in the thread that @dadoonet https://github.com/dadoonet proposed a course of inquiry, could you please tell me what the result of that was?

— Reply to this email directly, view it on GitHub https://github.com/elastic/elasticsearch-java/issues/752#issuecomment-1969505994, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJKQL5HLX5UOMBMHJG44DDYV5TPTAVCNFSM6AAAAABDVBAGUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRZGUYDKOJZGQ . You are receiving this because you authored the thread.Message ID: @.***>

dadoonet commented 6 months ago

Closing then. Thanks.