Issue with elasticsearch update 5.0.0-alpha5


(LamLANG) #1

Hello everyone,

I have some issue using elasticsearch communication with my java app

org.elasticsearch.transport.NodeDisconnectedException: [][x.x.x.x:9300][cluster:monitor/nodes/liveness] disconnected

2017-01-18 12:33:50.291  INFO 87773 --- [           main] org.elasticsearch.client.transport       : [Elektro] failed to get node info for {#transport#-3}{x.x.x.x}{x.x.x.x:9300}, disconnecting...

on cluster client node

[2017-01-18 09:33:43,634][WARN ][transport.netty4         ] [centos-2gb-fra1-03] exception caught on transport layer    [[id: 0x9222c4ec, L:/10.19.0.x:9300 - R:/105.63.184.x:44348]], closing connection
java.lang.IllegalStateException: Received message from unsupported version: [2.0.0] minimal compatible version is: [5.0.0-alpha5]
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1192)
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:280)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:396)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at ...

Here is my config

Settings settings = Settings.builder().put("cluster.name", "hiv-x").build();

    TransportClient client = PreBuiltTransportClient.builder().settings(settings).build();

    client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("hiv-fra1-01"), 9300));
    client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("hiv-fra1-02"), 9300));
    client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("hiv-fra1-03"), 9300));

    return client;

Here is the pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.xxx</groupId>
<artifactId>comments</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>comments</name>
<description>Comments for xxx.com</description>

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>1.4.2.RELEASE</version>
</parent>

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<java.version>1.8</java.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>transport</artifactId>
        <version>5.0.2</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.0</version>
    </dependency>
    <dependency>
        <groupId>com.mashape.unirest</groupId>
        <artifactId>unirest-java</artifactId>
        <version>1.4.9</version>
    </dependency>
	<dependency>
		<groupId>com.hazelcast</groupId>
		<artifactId>hazelcast</artifactId>
		<version>3.7.3</version>
	</dependency>
	<dependency>
		<groupId>com.jayway.jsonpath</groupId>
		<artifactId>json-path</artifactId>
		<version>2.2.0</version>
	</dependency>
	<dependency>
		<groupId>io.jsonwebtoken</groupId>
		<artifactId>jjwt</artifactId>
		<version>0.7.0</version>
	</dependency>
    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport</artifactId>
        <version>5.0.0.Alpha2</version>
    </dependency>
</dependencies>
<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
	</plugins>
</build>

<repositories>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/libs-milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

</project>

Thats been 1 days i am trying to figure out, an help would be awesome :smiley:


(Isabel Drost-Fromm) #2

From the exception you posted here:

I think you are running into the same issue discussed here:

To quote from the thread: "You probably have a Node or a Transport client somewhere running 2.0.0 which is trying to communicate with your node which is running 5.0.0?"

Hope this helps,
Isabel


(LamLANG) #3

slightly the same, but i have no transport client using the version 2.0.0

i will recheck right now dependency tree, maybe i missed something


(LamLANG) #4

Seems to be an issue between spring boot and elasticsearch 5.x

Caused by: java.lang.NoClassDefFoundError: org/elasticsearch/plugins/ActionPlugin
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<clinit>(PreBuiltTransportClient.java:54)
at com.hivisasa.config.ElasticsearchConfig.transportClient(ElasticsearchConfig.java:31)
at com.hivisasa.config.ElasticsearchConfig$$EnhancerBySpringCGLIB$$c797c2e.CGLIB$transportClient$1(<generated>)
at com.hivisasa.config.ElasticsearchConfig$$EnhancerBySpringCGLIB$$c797c2e$$FastClassBySpringCGLIB$$239224ef.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
at com.hivisasa.config.ElasticsearchConfig$$EnhancerBySpringCGLIB$$c797c2e.transportClient(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 51 more
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.plugins.ActionPlugin
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 74 more

Did someone manage to solve that compatibility issue?


(Isabel Drost-Fromm) #5

Last time I checked Spring only supports ES<5.0

See also their support matrix:


(LamLANG) #6

Aie spring data is not supporting version 5.0.0


(system) #7

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