将elasticsearch.jar从1.7.5升级到2.3.5

时间:2016-09-01 10:33:49

标签: elasticsearch elasticsearch-2.0

我已将客户端(elasticsearch.jar)从1.7.5升级到2.3.5。主要更改之一是org.elasticsearch.client.transport.TransportClient。在1.7.5版本中,org.elasticsearch.client.transport.TransportClient具有没有arg构造函数的公共构造函数。在我的applicationContext-search.xml中,我们之前已将"bean id="transportClient" class="org.elasticsearch.client.transport.TransportClient"/>替换为

<bean id="transportClient" class="org.elasticsearch.client.transport.TransportClient" factory-method="builder">
/bean>
<bean id="transportClient1" factory-bean="transportClient" factory-method="build" >
</bean>

现在,当我开始调用弹性搜索的服务时,我最终会出现以下错误

[01 Sep 2016 15:14:27,390] WARN [] [elasticsearch[Carolyn Trainer][transport_client_worker][T#1]{New I/O worker #1}] [org.elasticsearch.transport.netty.NettyTransport] [Carolyn Trainer] exception caught on transport layer [[id: 0xfaea1184, /127.0.0.1:63786 => localhost/127.0.0.1:9300]], closing connection
java.lang.NullPointerException
at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:207)
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:202)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:136)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

弹性搜索设置是开发环境中的一个节点。 有人可以帮助我发生什么事吗?

此致 梅尼

1 个答案:

答案 0 :(得分:1)

这是我的错。我做的是,在2.3.5上运行客户端(elasticsearch.jar)和在1.3.2上运行服务器 我升级服务器以匹配我的客户端,从1.3.2升级到2.3.5并且事情已经完成且工作正常。 因此,最后,确保客户端和服务器在相同版本的elasticsearch上运行.....

此致 梅尼