iohao / ioGame

无锁异步化、事件驱动架构设计的 java netty 网络编程框架; 轻量级,无需依赖任何第三方中间件或数据库就能支持集群、分布式; 适用于网络游戏服务器、物联网、内部系统及各种需要长连接的场景; 通过 ioGame 你可以很容易的搭建出一个集群无中心节点、集群自动化、分布式的网络服务器;FXGL、Unity、UE、Cocos Creator、Godot、Netty、Protobuf、webSocket、tcp、socket;java Netty 游戏服务器框架;
http://game.iohao.com
GNU Affero General Public License v3.0
904 stars 201 forks source link

在接收到客户端请求时protobuf报错 #352

Closed Linorman closed 2 months ago

Linorman commented 2 months ago

你的问题 | 使用场景

描述你遇到的问题,或使用场景(询问框架能否满足此类需求)

在接受到用户请求时后断开连接,后端报错:

预期值

期望的预期值

实际值

实际值

复现步骤

描述复现步骤,并提供复现 demo `java.lang.ExceptionInInitializerError: null at com.baidu.bjf.remoting.protobuf.ProtobufProxy.doCreate(ProtobufProxy.java:263) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:174) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:155) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:128) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:116) ~[jprotobuf-2.4.22.jar!/:na] at com.iohao.game.common.kit.ProtoKit.parseProtoByte(ProtoKit.java:77) ~[common-kit-21.9.jar!/:na] at org.tova.utils.ProtoDataCodec.decode(ProtoDataCodec.java:31) ~[!/:0.0.1-SNAPSHOT] at com.iohao.game.action.skeleton.core.DataCodecKit.decode(DataCodecKit.java:64) ~[common-core-21.9.jar!/:na] at com.iohao.game.external.core.netty.handler.codec.WebSocketExternalCodec.decode(WebSocketExternalCodec.java:67) ~[external-netty-21.9.jar!/:na] at com.iohao.game.external.core.netty.handler.codec.WebSocketExternalCodec.decode(WebSocketExternalCodec.java:38) ~[external-netty-21.9.jar!/:na] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:89) ~[netty-codec-http-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final] at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na] Caused by: java.lang.RuntimeException: nested:/home/multi-user-service-sp/target/multi-user-service-sp-0.0.1-SNAPSHOT.jar not exist at com.baidu.bjf.remoting.protobuf.utils.ZipUtils.unZip(ZipUtils.java:55) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.utils.compiler.JdkCompiler.(JdkCompiler.java:161) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.utils.compiler.JdkCompiler.(JdkCompiler.java:103) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.utils.JDKCompilerHelper.(JDKCompilerHelper.java:33) ~[jprotobuf-2.4.22.jar!/:na] ... 40 common frames omitted

2024-08-11T11:46:51.075+08:00 WARN 9296 --- [server-worker-1] i.netty.channel.DefaultChannelPipeline : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.

java.lang.ExceptionInInitializerError: null at com.baidu.bjf.remoting.protobuf.ProtobufProxy.doCreate(ProtobufProxy.java:263) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:174) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:155) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:128) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:116) ~[jprotobuf-2.4.22.jar!/:na] at com.iohao.game.common.kit.ProtoKit.parseProtoByte(ProtoKit.java:77) ~[common-kit-21.9.jar!/:na] at org.tova.utils.ProtoDataCodec.decode(ProtoDataCodec.java:31) ~[!/:0.0.1-SNAPSHOT] at com.iohao.game.action.skeleton.core.DataCodecKit.decode(DataCodecKit.java:64) ~[common-core-21.9.jar!/:na] at com.iohao.game.external.core.netty.handler.codec.WebSocketExternalCodec.decode(WebSocketExternalCodec.java:67) ~[external-netty-21.9.jar!/:na] at com.iohao.game.external.core.netty.handler.codec.WebSocketExternalCodec.decode(WebSocketExternalCodec.java:38) ~[external-netty-21.9.jar!/:na] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:89) ~[netty-codec-http-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final] at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na] Caused by: java.lang.RuntimeException: nested:/home/multi-user-service-sp/target/multi-user-service-sp-0.0.1-SNAPSHOT.jar not exist at com.baidu.bjf.remoting.protobuf.utils.ZipUtils.unZip(ZipUtils.java:55) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.utils.compiler.JdkCompiler.(JdkCompiler.java:161) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.utils.compiler.JdkCompiler.(JdkCompiler.java:103) ~[jprotobuf-2.4.22.jar!/:na] at com.baidu.bjf.remoting.protobuf.utils.JDKCompilerHelper.(JDKCompilerHelper.java:33) ~[jprotobuf-2.4.22.jar!/:na] ... 40 common frames omitted 2024-08-11T11:51:13.629+08:00 ERROR 9296 --- [server-worker-2] c.i.g.e.c.n.handler.SimpleLoggerHandler : recvAddress(..) failed: Connection reset by peer

io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer

2024-08-11T11:51:13.630+08:00 WARN 9296 --- [server-worker-2] i.netty.channel.DefaultChannelPipeline : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.

io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer`

似乎是jprotobuf的报错,请问具体是什么原因呢?

版本

Linorman commented 2 months ago

测试平台:Ubuntu 22.04 amd

Linorman commented 2 months ago

iogame version: 21.9

iohao commented 2 months ago

请尝试使用最新版本,或到相关社区交流 https://github.com/jhunters/jprotobuf/issues

Linorman commented 2 months ago

请尝试使用最新版本,或到相关社区交流 https://github.com/jhunters/jprotobuf/issues

ok更新后解决了,谢谢