elasticsearch NoClassDefFoundError error creating RestHighLevelClient bean

NoClassDefFoundError is usually a configuration error – which means that the code you use refers to a class, but the class itself is not in the classpath. In this case, this may also be a dependency management error in the relevant elasticsearch POMS itself, because it should contain the required classes

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

Complete dependency, OK
(pay attention to switching to your own version)
maybe your mood is broken at the moment. Don’t worry. I believe it will bring you good luck _

Read More: