ElasticSearch 2.0 Java API: java.lang.ClassNotFoundException: org.elasticsearch.common.settings.ImmutableSettings $ Builder

I updated my Spring boot project to use the new ElasticSearch 2 API, and I get this error on startup:

Caused by: java.lang.NoClassDefFoundError: org/elasticsearch/common/settings/ImmutableSettings$Builder
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)

My respective Maven dependencies:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
        <version>1.3.0.M5</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>2.0.0-rc1</version>
    </dependency>

Do you have any hint at what I'm doing wrong?

thanks

+4
source share
1 answer

In ES 2.0, the class is ImmutableSettingsreally removed. This question mentions this, and violation of documentation of changes for version 2.0 also mention this.

Settings.builder() ImmutableSettings.builder(). Settings

, - ImmutableSettings, - 2.0 Elasticsearch.

+3

Source: https://habr.com/ru/post/1612721/


All Articles