前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >io.protostuff.runtime.RuntimeUnsafeFieldFactory cannot have the same number

io.protostuff.runtime.RuntimeUnsafeFieldFactory cannot have the same number

作者头像
MickyInvQ
发布2020-09-27 15:17:21
7500
发布2020-09-27 15:17:21
举报
文章被收录于专栏:InvQ的专栏InvQ的专栏

报错

消费方调用rpc pb序列化报错如下:

代码语言:javascript
复制
ExecutionException: java.lang.RuntimeException: io.netty.handler.codec.EncoderException: java.lang.IllegalStateException: io.protostuff.runtime.Runti
meUnsafeFieldFactory$9$1@254189a5 and io.protostuff.runtime.RuntimeUnsafeFieldFactory$9$1@5b03de85 cannot have the same number.
io.netty.handler.codec.EncoderException: java.lang.IllegalStateException: io.protostuff.runtime.RuntimeUnsafeFieldFactory$9$1@254189a5 and io.protostuff.runt
ime.RuntimeUnsafeFieldFactory$9$1@5b03de85 cannot have the same number.
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:125)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:749)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:741)
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:827)
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:734)
        at io.netty.handler.timeout.IdleStateHandler.write(IdleStateHandler.java:286)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:749)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:741)
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:827)
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:734)
        at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:106)
        at org.apache.dubbo.remoting.transport.netty4.NettyClientHandler.write(NettyClientHandler.java:87)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:749)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:741)
        at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:39)
        at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1100)
        at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1147)
        at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1089)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:454)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: io.protostuff.runtime.RuntimeUnsafeFieldFactory$9$1@254189a5 and io.protostuff.runtime.RuntimeUnsafeFieldFactory$
9$1@5b03de85 cannot have the same number.
        at io.protostuff.runtime.ArrayFieldMap.<init>(ArrayFieldMap.java:44)
        at io.protostuff.runtime.RuntimeSchema.createFieldMap(RuntimeSchema.java:381)
        at io.protostuff.runtime.RuntimeSchema.<init>(RuntimeSchema.java:360)
        at io.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:282)
        at io.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:187)

源码 及 解决

在这里插入图片描述
在这里插入图片描述

可以看到,在循环字段的时候,如果filed数组不为空,那么说明编号重复。 反查代码:有两个一样的编号。

在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-07-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 报错
  • 源码 及 解决
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档