Hello, I'm trying to use the high level API like this:

    final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            new UsernamePasswordCredentials("user", "pass"));

    RestClientBuilder builder = RestClient.builder(
            new HttpHost("host1", 9200, "http"),
            new HttpHost("host2", 9200, "http")
            .setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
                public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) 		   {
                    return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);

    RestHighLevelClient esClient = new RestHighLevelClient(builder);

    SearchRequest searchRequest = new SearchRequest("my_index");
    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();

    SearchResponse searchResponse =;

And getting error:
Handler dispatch failed; nested exception is java.lang.BootstrapMethodError: java.lang.NoSuchMethodError:;)Lorg/elasticsearch/action/search/SearchResponse;

I have dependencies in maven:


What can be wrong?

P.S. The old (low level) API works well for me

I am pretty sure that what you have in your classpath at runtime is not 6.3.2 but rather an older version that does not support parsing back responses. I am talking about the elasticsearch dependency. Can you check your classpath please? Seems like the code gets compiled right with the proper versions, but then at runtime something else is available.


1 Like

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