title: Spring Boot with Elastic Search causing java.lang.NoSuchFieldError: IGNORE_DEPRECATIONS
body: <p>I'm new to Elastic search. Started building a Spring boot application with Elastic search.</p>
  
  <p>Using the latest ES version <code>"elasticsearch-7.7.1"</code> and for integration, I'm using below maven dependency:</p>
  
  <pre><code>    &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;7.7.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Added below configuration to my spring boot app:</p>
  
  <pre><code>@Configuration
  public class ESConfig {
  
    @Bean(destroyMethod = "close")
    public RestHighLevelClient client() {
      RestHighLevelClient restHighLevelClient = new RestHighLevelClient(
          RestClient.builder(new HttpHost("localhost")));
      return restHighLevelClient;
    }
  
  }
  </code></pre>
  
  <p>Added below properties to application.yaml</p>
  
  <pre><code>elasticsearch:
    host: localhost
  </code></pre>
  
  <p>Getting below Exception on Application startup:</p>
  
  <pre><code>Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.RestHighLevelClient]: Factory method 'client' threw exception; nested exception is java.lang.NoSuchFieldError: IGNORE_DEPRECATIONS
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
      at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
      ... 19 common frames omitted
  Caused by: java.lang.NoSuchFieldError: IGNORE_DEPRECATIONS
      at org.elasticsearch.client.RestHighLevelClient.&lt;clinit&gt;(RestHighLevelClient.java:1902)
      at com.sbs.communicationcontrol.search.config.ESConfig.client(ESConfig.java:14)
  </code></pre>
  
  <p><strong>Can anyone please help why this exception occurred?</strong></p>