Skip to content

Commit c180171

Browse files
authored
Added more breaking changes to the 9.0 docs (#1004)
* added more breaking changes * docs syntax fix * added known issues * fix md reference * specific error * formatting titles
1 parent 1962cfa commit c180171

File tree

6 files changed

+104
-1
lines changed

6 files changed

+104
-1
lines changed

docs/reference/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ toc:
4242
- file: no-such-method-request-options.md
4343
- file: io-reactor-errors.md
4444
- file: serialize-without-typed-keys.md
45+
- file: could-not-resolve-dependencies.md
46+
- file: no-class-def-found-error.md
4547

4648
- folder: transport
4749
children:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
navigation_title: Could not resolve dependencies
3+
mapped_pages:
4+
- https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/could-not-resolve-dependencies.html
5+
---
6+
7+
# Could not resolve dependencies
8+
9+
Check the [Known Issues](/release-notes/known-issues.md#known-issues-8-16-7)

docs/reference/troubleshooting/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ mapped_pages:
1010
* [](missing-required-property.md)
1111
* [](no-such-method-request-options.md)
1212
* [](io-reactor-errors.md)
13+
* [](could-not-resolve-dependencies.md)
14+
* [](no-class-def-found-error.md)
1315

1416
## Miscellaneous
1517

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
navigation_title: "NoClassDefFoundError: LogFactory"
3+
mapped_pages:
4+
- https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/no-class-def-found-error.html
5+
---
6+
7+
# `NoClassDefFoundError`: org/apache/commons/logging/LogFactory
8+
9+
Check the [Known Issues](/release-notes/known-issues.md#known-issues-9-0-0)

docs/release-notes/9-0-0.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,40 @@ Discover what changed in the 9.0.0 version of the Java client.
77

88
### Breaking changes [elasticsearch-java-client-900-breaking-changes]
99

10+
::::{dropdown} Java version update
11+
While previous versions of the client used to target Java 8, from version 9.0 forward the client will target Java 17.
12+
13+
**Impact**<br>
14+
Any project that targets Java 8 and needs to import version 9.0 of the elasticsearch Java client.
15+
16+
**Action**<br>
17+
Projects that import version 9.0 of the elasticsearch Java client as a dependency will have to be updated to be compatible Java 17.
18+
19+
::::
20+
21+
::::{dropdown} RestClient optional dependency
22+
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.
23+
24+
**Impact**<br>
25+
Any project updating the elasticsearch Java client.
26+
27+
**Action**<br>
28+
Either update the code to use the new [Rest5Client](/reference/transport/rest5-client/index.md) or import the `elasticsearch-rest-client` dependency:
29+
```kotlin
30+
// gradle
31+
implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0")
32+
```
33+
```xml
34+
<!--maven-->
35+
<dependency>
36+
<groupId>org.elasticsearch.client</groupId>
37+
<artifactId>elasticsearch-rest-client</artifactId>
38+
<version>9.0.0</version>
39+
</dependency>
40+
```
41+
42+
::::
43+
1044
::::{dropdown} Server accurate aggregation number values
1145
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.
1246

@@ -329,7 +363,7 @@ ElasticsearchClient esClient = ElasticsearchClient.of(b -> b
329363
.apiKey(apiKey)
330364
);
331365
```
332-
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:
366+
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:
333367
```
334368
implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0")
335369
```

docs/release-notes/known-issues.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,50 @@ navigation_title: "Known issues"
66
# Elasticsearch Java Client known issues [elasticsearch-java-client-known-issues]
77

88
We handle all of our issues in our [Github repo](https://github.com/elastic/elasticsearch-java/issues).
9+
10+
### 8.16.7 [known-issues-8-16-7]
11+
12+
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:
13+
```
14+
Could not resolve dependencies for project
15+
[ERROR] dependency: org.elasticsearch.client:elasticsearch-rest-client:jar:8.16.7 (compile)
16+
[ERROR] Could not find artifact org.elasticsearch.client:elasticsearch-rest-client:jar:8.16.7 in central (https://repo.maven.apache.org/maven2)
17+
```
18+
To use this version of the client, set the latest available version explicitly in the project:
19+
```kotlin
20+
// gradle
21+
implementation("org.elasticsearch.client:elasticsearch-rest-client:8.16.6")
22+
```
23+
```xml
24+
<!--maven-->
25+
<dependency>
26+
<groupId>org.elasticsearch.client</groupId>
27+
<artifactId>elasticsearch-rest-client</artifactId>
28+
<version>8.16.6</version>
29+
</dependency>
30+
```
31+
32+
### 9.0.0 [known-issues-9-0-0]
33+
34+
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:
35+
```
36+
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
37+
at co.elastic.clients.transport.rest5_client.low_level.Rest5Client.<clinit>(Rest5Client.java:115)
38+
at co.elastic.clients.transport.rest5_client.Rest5ClientTransport.buildRest5Client(Rest5ClientTransport.java:65)
39+
at co.elastic.clients.transport.rest5_client.Rest5ClientTransport.<init>(Rest5ClientTransport.java:42)
40+
at co.elastic.clients.transport.ElasticsearchTransportConfig$Default.buildTransport(ElasticsearchTransportConfig.java:110)
41+
at co.elastic.clients.elasticsearch.ElasticsearchClient.of(ElasticsearchClient.java:190)
42+
```
43+
To use the new Rest5Client, add the `commons-logging` dependency:
44+
```kotlin
45+
// gradle
46+
implementation("commons-logging:commons-logging:1.3.5")
47+
```
48+
```xml
49+
<!--maven-->
50+
<dependency>
51+
<groupId>commons-logging</groupId>
52+
<artifactId>commons-logging</artifactId>
53+
<version>1.3.5</version>
54+
</dependency>
55+
```

0 commit comments

Comments
 (0)