Skip to content

Added more breaking changes to the 9.0 docs #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/reference/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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.md#known-issues-8-16-7)
2 changes: 2 additions & 0 deletions docs/reference/troubleshooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions docs/reference/troubleshooting/no-class-def-found-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
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

Check the [Known Issues](/release-notes/known-issues.md#known-issues-9-0-0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoClassDefFoundError is very generic, we should be more precise so that users can know here if this applies, like "NoClassDefFoundError(org/apache/commons/logging/LogFactory)"

36 changes: 35 additions & 1 deletion docs/release-notes/9-0-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**<br>
Any project that targets Java 8 and needs to import version 9.0 of the elasticsearch Java client.

**Action**<br>
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**<br>
Any project updating the elasticsearch Java client.

**Action**<br>
Either update the code to use the new [Rest5Client](/reference/transport/rest5-client/index.md) or import the `elasticsearch-rest-client` dependency:
```kotlin
// gradle
implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0")
```
```xml
<!--maven-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>9.0.0</version>
</dependency>
```

::::

::::{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.

Expand Down Expand Up @@ -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")
```
Expand Down
47 changes: 47 additions & 0 deletions docs/release-notes/known-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!--maven-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>8.16.6</version>
</dependency>
```

### 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.<clinit>(Rest5Client.java:115)
at co.elastic.clients.transport.rest5_client.Rest5ClientTransport.buildRest5Client(Rest5ClientTransport.java:65)
at co.elastic.clients.transport.rest5_client.Rest5ClientTransport.<init>(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
<!--maven-->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.5</version>
</dependency>
```
Loading