title: Elasticsearch method not being found in spring boot
body: <p>I have been stuck with this issue for a while now and any assistance is appreciated. I am running Spring Boot version <code>2.2.0</code> with the ElasticSearch high-level REST Client version <code>6.4.3</code> and using version <code>3.2.0</code> for the Spring-Data-Elasticsearch version. I am getting the error below. I have tried the following attempts to fix but none do.</p>
  
  <ol>
  <li>Change Spring Boot Version multiple times </li>
  <li>Change ES version multiple times</li>
  <li>I have cleared my .m2 folder and redownloaded the maven dependencies multiple times.</li>
  </ol>
  
  <p>The issue I am getting below is </p>
  
  <p><strong>An attempt was made to call a method that does not exist. The attempt was made from the following location:</strong></p>
  
  <blockquote>
    <p>org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.putMapping(ElasticsearchRestTemplate.java:292)</p>
  </blockquote>
  
  <p><strong>The following method did not exist:</strong></p>
  
  <blockquote>
    <p>org.elasticsearch.client.IndicesClient.putMapping(Lorg/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest;Lorg/elasticsearch/client/RequestOptions;)Lorg/elasticsearch/action/support/master/AcknowledgedResponse;</p>
  </blockquote>
  
  <p>The method's class, org.elasticsearch.client.IndicesClient, is available from the following locations:</p>
  
  <blockquote>
    <p>jar:file:/Users/user/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.4.3/elasticsearch-rest-high-level-client-6.4.3.jar!/org/elasticsearch/client/IndicesClient.class</p>
  </blockquote>
  
  <p>It was loaded from the following location:
      file:/Users/user/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.4.3/elasticsearch-rest-high-level-client-6.4.3.jar</p>
  
  <p>Action:
  <strong>Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.IndicesClient</strong></p>
  
  <p>My POM is below</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-elasticsearch&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-elasticsearch&lt;/artifactId&gt;
          &lt;version&gt;3.2.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Any help is appreciated. I am sure it has to deal with compatibility issues but not sure which. Thanks all!</p>
  
  <h2>Update</h2>
  
  <p>I was able to get it run sucessfully by changing my elasticsearch version to <code>6.7.0</code>. But now I am receiving the following error</p>
  
  <pre><code>org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=index_not_found_exception, reason=no such index]
  </code></pre>
  
  <p>My POM looks like this below now also.</p>
  
  <pre><code>    &lt;dependency&gt;
              &lt;groupId&gt;org.elasticsearch&lt;/groupId&gt;
              &lt;artifactId&gt;elasticsearch&lt;/artifactId&gt;
              &lt;version&gt;6.70&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.client&lt;/groupId&gt;
          &lt;artifactId&gt;elasticsearch-rest-high-level-client&lt;/artifactId&gt;
          &lt;version&gt;6.70&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.client&lt;/groupId&gt;
          &lt;artifactId&gt;elasticsearch-rest-client&lt;/artifactId&gt;
          &lt;version&gt;6.70&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>