title: configuration Elasticsearch to java SpringBoot Application
body: <p>I am trying to configure  Elastic to SpringBoot Application with  Jdk 1.8 and elastic search Versi7.6.61<br>
     and Current spring version 2.2.5.RELEASE</p>
  
  <pre><code>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
     &lt;version&gt;2.2.5.RELEASE&lt;/version&gt;
     &lt;relativePath/&gt;
  </code></pre>
  
  <p>//these are pom for elastic search</p>
  
  <pre><code>&lt;dependency&gt;
        &lt;groupId&gt;org.elasticsearch&lt;/groupId&gt;
        &lt;artifactId&gt;elasticsearch&lt;/artifactId&gt;
        &lt;version&gt;${org.elasticsearch}&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;${org.elasticsearch}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.elasticsearch.client&lt;/groupId&gt;
        &lt;artifactId&gt;elasticsearch-rest-client-sniffer&lt;/artifactId&gt;
        &lt;version&gt;${org.elasticsearch}&lt;/version&gt;
      &lt;/dependency&gt;
         &lt;dependency&gt;
        &lt;groupId&gt;org.elasticsearch.client&lt;/groupId&gt;
        &lt;artifactId&gt;transport&lt;/artifactId&gt;
        &lt;version&gt;${org.elasticsearch}&lt;/version&gt;
      &lt;/dependency&gt; 
  </code></pre>
  
  <p>currently, I am using the latest release of Elasticsearch version 7.6.1
      I got the following the Java JDK version is 1.8  Exception </p>
  
  <pre><code>     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticsearchRestHighLevelClient' defined in class path resource \[org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientConfigurations$RestHighLevelClientConfiguration.class\]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class \[org.elasticsearch.client.RestHighLevelClient\] from ClassLoader \[sun.misc.Launcher$AppClassLoader@18b4aac2\]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~\[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~\[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~\[spring-boot-2.2.3.RELEASE.jar:2.2.3.RELEASE\]
              at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) \[spring-boot-2.2.3.RELEASE.jar:2.2.3.RELEASE\]
              at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) \[spring-boot-2.2.3.RELEASE.jar:2.2.3.RELEASE\]
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) \[spring-boot-2.2.3.RELEASE.jar:2.2.3.RELEASE\]
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) \[spring-boot-2.2.3.RELEASE.jar:2.2.3.RELEASE\]
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) \[spring-boot-2.2.3.RELEASE.jar:2.2.3.RELEASE\]
              at io.dz.ReIndexing.main(ReIndexing.java:13) \[classes/:na\]
          Caused by: java.lang.IllegalStateException: Failed to introspect Class \[org.elasticsearch.client.RestHighLevelClient\] from ClassLoader \[sun.misc.Launcher$AppClassLoader@18b4aac2\]
              at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481) ~\[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321) ~\[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:232) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:210) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(InitDestroyAnnotationBeanPostProcessor.java:149) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:310) ~\[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:1094) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:569) ~\[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              ... 15 common frames omitted
          Caused by: java.lang.NoClassDefFoundError: org/elasticsearch/client/Cancellable
              at java.lang.Class.getDeclaredMethods0(Native Method) ~\[na:1.8.0_161\]
              at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~\[na:1.8.0_161\]
              at java.lang.Class.getDeclaredMethods(Class.java:1975) ~\[na:1.8.0_161\]
              at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463) ~\[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE\]
              ... 22 common frames omitted
          Caused by: java.lang.ClassNotFoundException: org.elasticsearch.client.Cancellable
              at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~\[na:1.8.0_161\]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~\[na:1.8.0_161\]
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~\[na:1.8.0_161\]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~\[na:1.8.0_161\]
              ... 26 common frames omitted
  
  
  //when I am trying to configure Elastic search I got the Exception class not Found 
  thanks in Advance to reply][1]][1]  
  </code></pre>