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).