michele
michele

Reputation: 26598

Spring boot and elastic search unsupported version minimal compatible version

This is my pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 it.test searchTest 0.0.1-SNAPSHOT

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.M5</version>
</parent>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- Runtime, for Embedded Elasticsearch,
        comment this if connect to external elastic search server-->

    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>transport</artifactId>

    </dependency>
</dependencies>

<build>
    <plugins>
        <!-- Package as an executable jar/war -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

When I start my project I have returned this stack trace:

    [2017-12-15T13:36:15,670][WARN ][o.e.t.n.Netty4Transport  ] [node1] exception caught on transport layer [org.elasticsearch.transport.netty4.NettyTcpChannel@7c08d374], closing connection
java.lang.IllegalStateException: Received message from unsupported version: [5.5.3] minimal compatible version is: [5.6.0]
        at org.elasticsearch.transport.TcpTransport.ensureVersionCompatibility(TcpTransport.java:1428) ~[elasticsearch-6.1.0.jar:6.1.0]
        at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1375) ~[elasticsearch-6.1.0.jar:6.1.0]
        at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:64) ~[transport-netty4-6.1.0.jar:6.1.0]

What I have to change in my pom to solve this incompatibility?

Thanks

Upvotes: 2

Views: 5262

Answers (4)

DaddyMoe
DaddyMoe

Reputation: 1020

I always find the Spring data elasticsearch matrix table useful for figuring out what compatible version to use.

To change version of ES from to a compatible version use the Spring Boot dedicated module to specify dependency versions. Add elasticsearch.version into your pom properties

<properties>
    ...
    <elasticsearch.version>1.7.2</elasticsearch.version>
    ...
</properties>

enter image description here

Upvotes: 1

Gopal
Gopal

Reputation: 795

i too was getting similar error but got resolved, before which i like to highlight my spring boot starter parent version which is 1.5.9.RELEASE, secondly i was using spring-boot-starter-data-elasticsearch artifact alone for spring boot elastic search and other artifacts can be removed, finally the phenomenal issue which you are receiving with the elastic search application which you have installed, try to download this version https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-0 and try again....

Upvotes: 0

Jack Zhou
Jack Zhou

Reputation: 183

What is the version of your ElasticSearch, Maybe you can try to add this property in your pom like this.

<properties>
    <elasticsearch.version>6.1.0</elasticsearch.version>
</properties>

Upvotes: 2

dadoonet
dadoonet

Reputation: 14492

Change the transport version to be the same as your elasticsearch instance

Upvotes: 3

Related Questions