From 5384d0ef01bfe5c58f1428ea4f97bb663e7c0fdc Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 29 Apr 2025 17:20:28 +0200 Subject: [PATCH 1/6] added more breaking changes --- docs/release-notes/9-0-0.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/9-0-0.md b/docs/release-notes/9-0-0.md index 159ecdfbb..1876ef7bb 100644 --- a/docs/release-notes/9-0-0.md +++ b/docs/release-notes/9-0-0.md @@ -7,6 +7,40 @@ Discover what changed in the 9.0.0 version of the Java client. ### Breaking changes [elasticsearch-java-client-900-breaking-changes] +::::{dropdown} Java version update +While previous versions of the client used to target Java 8, from version 9.0 forward the client will target Java 17. + +**Impact**
+Any project that targets Java 8 and needs to import version 9.0 of the elasticsearch Java client. + +**Action**
+Projects that import version 9.0 of the elasticsearch Java client as a dependency will have to be updated to be compatible Java 17. + +:::: + +::::{dropdown} RestClient optional dependency +The new version of the client introduces the [Rest5Client](/reference/transport/rest5-client/index.md) as an alternative to the legacy RestClient. The RestClient is part of the external dependency `elasticsearch-rest-client`, which is now optional since an alternative is available. + +**Impact**
+Any project updating the elasticsearch Java client. + +**Action**
+Either update the code to use the new [Rest5Client](/reference/transport/rest5-client/index.md) or import the `elasticsearch-rest-client` dependency: +```kts +// gradle +implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0") +``` +```xml + + + org.elasticsearch.client + elasticsearch-rest-client + 9.0.0 + +``` + +:::: + ::::{dropdown} Server accurate aggregation number values In previous versions of the client, when the server returned number that was both always present and could be `null` (for example Aggregation results), the client would default to `0` and deserialize the number into a primitive data type instead of an Object. This design choice was changed in this version, changing the fields type to support `null` and be coherent with the server response. @@ -329,7 +363,7 @@ ElasticsearchClient esClient = ElasticsearchClient.of(b -> b .apiKey(apiKey) ); ``` -The classic version of the builder is still available, both with the new `Rest5Client` and the legacy `RestClient`; while the `Rest5Client` is included with the java client's dependency, the legacy `RestClient` must be imported separately: +The classic version of the builder is still available, both with the new `Rest5Client` and the legacy `RestClient`; while the `Rest5Client` is included with the Java client's dependency, the legacy `RestClient` must be imported separately: ``` implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0") ``` From 4b9e2fc54acde96c786dd4f2d24940b0266abf2e Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 29 Apr 2025 17:31:10 +0200 Subject: [PATCH 2/6] docs syntax fix --- docs/release-notes/9-0-0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/9-0-0.md b/docs/release-notes/9-0-0.md index 1876ef7bb..c7b25a216 100644 --- a/docs/release-notes/9-0-0.md +++ b/docs/release-notes/9-0-0.md @@ -26,7 +26,7 @@ Any project updating the elasticsearch Java client. **Action**
Either update the code to use the new [Rest5Client](/reference/transport/rest5-client/index.md) or import the `elasticsearch-rest-client` dependency: -```kts +```kotlin // gradle implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0") ``` From 47e0835c513acf5f7c6c77abec27506d7e764f97 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Wed, 30 Apr 2025 16:14:31 +0200 Subject: [PATCH 3/6] added known issues --- docs/reference/toc.yml | 2 + .../could-not-resolve-dependencies.md | 9 ++++ docs/reference/troubleshooting/index.md | 2 + .../no-class-def-found-error.md | 9 ++++ docs/release-notes/known-issues.md | 47 +++++++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 docs/reference/troubleshooting/could-not-resolve-dependencies.md create mode 100644 docs/reference/troubleshooting/no-class-def-found-error.md diff --git a/docs/reference/toc.yml b/docs/reference/toc.yml index 89d47d2df..0750df471 100644 --- a/docs/reference/toc.yml +++ b/docs/reference/toc.yml @@ -42,6 +42,8 @@ toc: - file: no-such-method-request-options.md - file: io-reactor-errors.md - file: serialize-without-typed-keys.md + - file: could-not-resolve-dependencies.md + - file: no-class-def-found-error.md - folder: transport children: diff --git a/docs/reference/troubleshooting/could-not-resolve-dependencies.md b/docs/reference/troubleshooting/could-not-resolve-dependencies.md new file mode 100644 index 000000000..a8c867a1e --- /dev/null +++ b/docs/reference/troubleshooting/could-not-resolve-dependencies.md @@ -0,0 +1,9 @@ +--- +navigation_title: Could not resolve dependencies +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/could-not-resolve-dependencies.html +--- + +# `Could not resolve dependencies` + +Check the [Known Issues](/release-notes/known-issues#known-issues-8-16-7) diff --git a/docs/reference/troubleshooting/index.md b/docs/reference/troubleshooting/index.md index 9922f95d4..c63ff6cf0 100644 --- a/docs/reference/troubleshooting/index.md +++ b/docs/reference/troubleshooting/index.md @@ -10,6 +10,8 @@ mapped_pages: * [](missing-required-property.md) * [](no-such-method-request-options.md) * [](io-reactor-errors.md) +* [](could-not-resolve-dependencies.md) +* [](no-class-def-found-error.md) ## Miscellaneous diff --git a/docs/reference/troubleshooting/no-class-def-found-error.md b/docs/reference/troubleshooting/no-class-def-found-error.md new file mode 100644 index 000000000..28cbb11a8 --- /dev/null +++ b/docs/reference/troubleshooting/no-class-def-found-error.md @@ -0,0 +1,9 @@ +--- +navigation_title: "NoClassDefFoundError" +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/no-class-def-found-error.html +--- + +# `NoClassDefFoundError` + +Check the [Known Issues](/release-notes/known-issues#known-issues-9-0-0) diff --git a/docs/release-notes/known-issues.md b/docs/release-notes/known-issues.md index 831cfd66b..7529e30ce 100644 --- a/docs/release-notes/known-issues.md +++ b/docs/release-notes/known-issues.md @@ -6,3 +6,50 @@ navigation_title: "Known issues" # Elasticsearch Java Client known issues [elasticsearch-java-client-known-issues] We handle all of our issues in our [Github repo](https://github.com/elastic/elasticsearch-java/issues). + +### 8.16.7 [known-issues-8-16-7] + +8.16.7 is the first patch released without a matching rest-client version, so the `elasticsearch-rest-client` dependency is missing, causing the following exception: +``` +Could not resolve dependencies for project +[ERROR] dependency: org.elasticsearch.client:elasticsearch-rest-client:jar:8.16.7 (compile) +[ERROR] Could not find artifact org.elasticsearch.client:elasticsearch-rest-client:jar:8.16.7 in central (https://repo.maven.apache.org/maven2) +``` +To use this version of the client, set the latest available version explicitly in the project: +```kotlin +// gradle +implementation("org.elasticsearch.client:elasticsearch-rest-client:8.16.6") +``` +```xml + + + org.elasticsearch.client + elasticsearch-rest-client + 8.16.6 + +``` + +### 9.0.0 [known-issues-9-0-0] + +The latest major version of the client doesn't depend on `elasticsearch-rest-client` anymore, as the new built in Rest5Client is available, but it does depend on the Apache `commons-logging` dependency, which is missing, causing the following exception: +``` +Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory + at co.elastic.clients.transport.rest5_client.low_level.Rest5Client.(Rest5Client.java:115) + at co.elastic.clients.transport.rest5_client.Rest5ClientTransport.buildRest5Client(Rest5ClientTransport.java:65) + at co.elastic.clients.transport.rest5_client.Rest5ClientTransport.(Rest5ClientTransport.java:42) + at co.elastic.clients.transport.ElasticsearchTransportConfig$Default.buildTransport(ElasticsearchTransportConfig.java:110) + at co.elastic.clients.elasticsearch.ElasticsearchClient.of(ElasticsearchClient.java:190) +``` +To use the new Rest5Client, add the `commons-logging` dependency: +```kotlin +// gradle +implementation("commons-logging:commons-logging:1.3.5") +``` +```xml + + + commons-logging + commons-logging + 1.3.5 + +``` From fd1e74d22e1c1a52839ce3b364f7038938c4d861 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Wed, 30 Apr 2025 16:39:55 +0200 Subject: [PATCH 4/6] fix md reference --- .../reference/troubleshooting/could-not-resolve-dependencies.md | 2 +- docs/reference/troubleshooting/no-class-def-found-error.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/troubleshooting/could-not-resolve-dependencies.md b/docs/reference/troubleshooting/could-not-resolve-dependencies.md index a8c867a1e..b0214051c 100644 --- a/docs/reference/troubleshooting/could-not-resolve-dependencies.md +++ b/docs/reference/troubleshooting/could-not-resolve-dependencies.md @@ -6,4 +6,4 @@ mapped_pages: # `Could not resolve dependencies` -Check the [Known Issues](/release-notes/known-issues#known-issues-8-16-7) +Check the [Known Issues](/release-notes/known-issues.md#known-issues-8-16-7) diff --git a/docs/reference/troubleshooting/no-class-def-found-error.md b/docs/reference/troubleshooting/no-class-def-found-error.md index 28cbb11a8..85ad33983 100644 --- a/docs/reference/troubleshooting/no-class-def-found-error.md +++ b/docs/reference/troubleshooting/no-class-def-found-error.md @@ -6,4 +6,4 @@ mapped_pages: # `NoClassDefFoundError` -Check the [Known Issues](/release-notes/known-issues#known-issues-9-0-0) +Check the [Known Issues](/release-notes/known-issues.md#known-issues-9-0-0) From ca80afdca3d6e47d4802922d95af3b2345545f50 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Wed, 30 Apr 2025 17:22:11 +0200 Subject: [PATCH 5/6] specific error --- docs/reference/troubleshooting/no-class-def-found-error.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/troubleshooting/no-class-def-found-error.md b/docs/reference/troubleshooting/no-class-def-found-error.md index 85ad33983..2f3084a69 100644 --- a/docs/reference/troubleshooting/no-class-def-found-error.md +++ b/docs/reference/troubleshooting/no-class-def-found-error.md @@ -1,9 +1,9 @@ --- -navigation_title: "NoClassDefFoundError" +navigation_title: "NoClassDefFoundError: org/apache/commons/logging/LogFactory" mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/no-class-def-found-error.html --- -# `NoClassDefFoundError` +# `NoClassDefFoundError: org/apache/commons/logging/LogFactory` Check the [Known Issues](/release-notes/known-issues.md#known-issues-9-0-0) From 14e86be918b498fb870d3dbbf71cc7b6671d772c Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Wed, 30 Apr 2025 17:27:13 +0200 Subject: [PATCH 6/6] formatting titles --- .../troubleshooting/could-not-resolve-dependencies.md | 2 +- docs/reference/troubleshooting/no-class-def-found-error.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/troubleshooting/could-not-resolve-dependencies.md b/docs/reference/troubleshooting/could-not-resolve-dependencies.md index b0214051c..2d8b6f27c 100644 --- a/docs/reference/troubleshooting/could-not-resolve-dependencies.md +++ b/docs/reference/troubleshooting/could-not-resolve-dependencies.md @@ -4,6 +4,6 @@ mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/could-not-resolve-dependencies.html --- -# `Could not resolve dependencies` +# Could not resolve dependencies Check the [Known Issues](/release-notes/known-issues.md#known-issues-8-16-7) diff --git a/docs/reference/troubleshooting/no-class-def-found-error.md b/docs/reference/troubleshooting/no-class-def-found-error.md index 2f3084a69..e7cab58d8 100644 --- a/docs/reference/troubleshooting/no-class-def-found-error.md +++ b/docs/reference/troubleshooting/no-class-def-found-error.md @@ -1,9 +1,9 @@ --- -navigation_title: "NoClassDefFoundError: org/apache/commons/logging/LogFactory" +navigation_title: "NoClassDefFoundError: LogFactory" mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/no-class-def-found-error.html --- -# `NoClassDefFoundError: org/apache/commons/logging/LogFactory` +# `NoClassDefFoundError`: org/apache/commons/logging/LogFactory Check the [Known Issues](/release-notes/known-issues.md#known-issues-9-0-0)