Problem migrating HLRC from 7.17.X to 8.X


I am in this situation: big project using elasticsearch rest high level client, 7.16.X, and want to migrate to 8.2.X or later, so I follow these guidelines Migrating from the High Level Rest Client | Elasticsearch Java API Client [8.3] | Elastic
But there is an incompatibility with XContentType

Exception in thread "I/O dispatcher 1" java.lang.NoSuchMethodError: 'org.elasticsearch.xcontent.XContentType org.elasticsearch.xcontent.XContentType.fromMediaTypeOrFormat(java.lang.String)' at org.elasticsearch.client.RestHighLevelClient.parseEntity( at org.elasticsearch.client.RestHighLevelClient.getVersionValidation( at org.elasticsearch.client.RestHighLevelClient.access$200( at org.elasticsearch.client.RestHighLevelClient$5.onSuccess( at org.elasticsearch.client.RestClient$FailureTrackingResponseListener.onSuccess( at org.elasticsearch.client.RestClient$1.completed( at org.elasticsearch.client.RestClient$1.completed(

(this method called by the 7.16/17 hlrc library on XContentType no longer exist in the 8.0/1/2 version of elasticsearch-x-content module)

How come you run both a java-api-client and a hlrc at the same time without hitting this conflict?

OK I figured out that I have a dependency to the whole elasticsearch 8.X. In that case, it is conflicting obviously, but if I stick to depending only on java-clients, there is no issue. I need to review the entire project to remove the elasticsearch dependency (which is certainly the intent behind creating java-clients)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.