gpt4 book ai didi

java - 从 Websphere 使用 Elasticsearch Java 客户端时出错

转载 作者:行者123 更新时间:2023-11-30 03:20:47 34 4
gpt4 key购买 nike

我有一个使用elasticsearch官方java客户端的Web应用程序。当使用 IBM JVM Java 7 在 Websphere 8.5.5 上使用该 Web 应用程序时,出现以下错误。我尝试使用传输客户端和节点客户端。还尝试使用 Oracle JavaSE 7 和 8 作为 Elasticsearch 的 JVM。但没有任何结果。Elasticsearch 不在 IBM JVM 上运行,而 Websphere 仅在 IBM JVM 上运行。

有人知道如何从 Websphere 上的应用程序使用 elasticsearch 官方 java 客户端吗?

下面是错误堆栈跟踪:

Caused by: org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:178)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:130)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
at java.lang.Thread.run(Thread.java:780)
Caused by: java.io.StreamCorruptedException: unexpected end of block data
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1438)
at java.io.ObjectInputStream.access$400(ObjectInputStream.java:217)
at java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2201)
at java.io.ObjectInputStream.readFields(ObjectInputStream.java:603)
at java.net.InetSocketAddress.readObject(InetSocketAddress.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1076)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1941)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1846)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1416)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2039)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1963)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1846)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1416)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2039)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1963)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1846)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1416)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:419)
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:176)
... 23 more

最佳答案

解决此问题的唯一方法是对两个 Java 应用程序使用相同的 JVM。使用不同更新版本的相同 JVM 之间的 Java 异常序列化可能不一致,显然这是 IBM 的 JVM 与您使用 Elasticsearch 运行的 JVM 之间的问题。

具体来说,Elasticsearch 不在 IBM JVM 上运行,因为 IBM JVM has bugs in it that prevent it from working correctly .

幸运的是,这里的前景正在变得更好IBM is working with Elasticsearch to get it working properly Elasticsearch is removing serialization in Elasticsearch 2.0 .

关于java - 从 Websphere 使用 Elasticsearch Java 客户端时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31391567/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com