org.elasticsearch.common.xcontent.DeprecationHandler Exception while using Elasticsearch REST High level client org.elasticsearch.common.xcontent.DeprecationHandler Exception while using Elasticsearch REST High level client elasticsearch elasticsearch

org.elasticsearch.common.xcontent.DeprecationHandler Exception while using Elasticsearch REST High level client


Yes, I found the following link useful to nail down the issue..

As per elasticsearch documentation, it is only required to add "elasticsearch-rest-high-level-client" dependency.. However, I just observed it in Gradle build that it picks up the other dependency with lower version number; in my case it is 5.6.10

enter image description here

Right now, I just added the following dependency as well in my build.gradle.

dependencies {    compile group: 'org.elasticsearch', name: 'elasticsearch', version: '6.4.0'    compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: '6.4.0'    compile('org.springframework.boot:spring-boot-starter-web')    testCompile('org.springframework.boot:spring-boot-starter-test')}

That resolves it. I see the same problem being reported in other forums but hope this helps them.. (may be Elasticsearch documentation have to include this as well).


I struggled with this problem. Basically the root cause of this exception is version mismatch for Elastic-Search Lib, elasticsearch-rest-high-level-client and ElasticSearch Server . I am using ElasticSearch Server 7.4 and Apache Flink 1.10. I have added following dependency in POM for Flink-Elastic-Search Sink:

 <dependency>            <groupId>org.apache.flink</groupId>            <artifactId>flink-connector-elasticsearch7_2.11</artifactId>            <version>1.10.0</version>        </dependency>    <dependency>            <groupId>org.elasticsearch.client</groupId>            <artifactId>elasticsearch-rest-high-level-client</artifactId>            <version>7.4.0</version>        </dependency>        <!-- https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch -->        <dependency>            <groupId>org.elasticsearch</groupId>            <artifactId>elasticsearch</artifactId>            <version>7.4.0</version>        </dependency>

This is working perfectly for me.

Note: Elastic-Search Server version and dependency version of elasticsearch-rest-high-level-client version, and Elastic-Search , SINK connector should be exactly same to avoid this issue.


I had the same problem. At last I found I have to provide the org.elasticsearch:elasticsearch dependency and keep the version same with my rest-high-level-client.

If I don't do that, it will default to org.elasticsearch:elasticsearch:5.6.10, but I am using rest-client 6.4.x