Dependency Error while using Java High Level Rest Client

Hi,
I am trying to develop a spring boot based elasticsearch project and I am trying to use Java High Level Rest Client in the same.
I am initializing the client like this:

Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/elasticsearch/common/CheckedConsumer

My pom.xml has the following dependencies:

       <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>6.2.4</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>6.2.4</version>
        </dependency>

Try add this:

            <dependency>
    			<groupId>org.elasticsearch.client</groupId>
    			<artifactId>elasticsearch-rest-client</artifactId>
    			<version>${es.version}</version>
    		</dependency>

Thanks, but still reported the same mistake.

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