Spring data elastic-search integration failing with Caused by: java.lang.NoSuchMethodError: org.elasticsearch.common.settings.Settings$Builder.put([Ljava/lang/Object;)Lorg/elasticsearch/common/settings/Settings$Builder;

I am upgrading elastic 2.x to 6.x. I have to update the spring data dependency as well to do the elastic upgrade. (Using elastic cloud managed service with x-pack-transport)

Here is my dependencies:

spring-data-elasticsearch 3.1.3.RELEASE
x-pack-transport 5.6.1

This include elasticsearch dependency version 6.2.2.

I am getting following error while initialize the spring application.

Caused by: java.lang.NoSuchMethodError: org.elasticsearch.common.settings.Settings$Builder.put([Ljava/lang/Object;)Lorg/elasticsearch/common/settings/Settings$Builder;

at org.elasticsearch.xpack.notification.email.Account.<clinit>(Account.java:71)

at org.elasticsearch.xpack.XPackPlugin.<clinit>(XPackPlugin.java:192)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:556)

There are other threads related to same issue but never answered, and closed .

Please let me know if you guys have any solution for this issue.

Why are you depending on x-pack-transport 5.6.1? This needs to be the same version as elasticsearch. The version you are including is expecting utilities and such within the elasticsearch server jar to be older versions.

x-pack-transport 5.6.1 is the latest stable version :slight_smile:

Hi @rjernst
I looked into it more and realized your answer is right, I was using dependency that is not compatible with elastic version 6.2.2 I have upgraded the x-pack-transport version to 6.2.2 and its working fine now.

And i am using spring version 5.x

Here is the updated dependency

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-elasticsearch</artifactId>
        <version>3.1.3.RELEASE</version>
    </dependency>


    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>x-pack-transport</artifactId>
        <version>6.2.2</version>
    </dependency>

Documentation available here: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack-client.html

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