Description
Type of issue
None
What documentation page is affected
https://www.elastic.co/docs/reference/elasticsearch/clients/java/setup/installation
What happened?
The paragraph about solving ClassNotFoundException: jakarta.json.spi.JsonProvider
recommends adding an explicit dependency to the version that the elasticsearch clients expects. This does not "solve" the problem, it just pushes it somewhere else.
Additional info
If there is a dependency conflict, chances are, another dependency requires and uses the jakarta.json-api in the old version with classes in the javax packages. So it will will fail with a ClassNotFoundException
on their part. This is why we call this dependency hell - there's no easy solution for it.
The workaround is usually a repackaging of the library under a different name, so you can have both dependencies included.