协议消息端组标记与预期标记不匹配

编程入门 行业动态 更新时间:2024-10-09 08:28:24
本文介绍了协议消息端组标记与预期标记不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直得到以下堆栈跟踪,我不确定它的含义。

I keep getting the following stack trace and am not sure what it means.

Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag. at com.google.protobuf.InvalidProtocolBufferException.invalidEndTag(InvalidProtocolBufferException.java:73) at com.google.protobuf.CodedInputStream.checkLastTagWas(CodedInputStream.java:124) at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:189) at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:732) at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238) at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:178) at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:724)

  • 协议消息结束 - 什么组标记与预期标记不匹配。意思?
  • 什么是消息端组标签?
  • 这是否记录在某处?
  • 推荐答案

    protobuf中的组被写为开始/结束数字对 - 有点像< foo> 需要< / foo> ,但格式不同。基本上它抱怨它发现了一个< / bar> (只是:xml只是一个比喻)。详细信息位于编码规范中,但其中有一个是:

    Groups in protobuf are written as a start/end numeric pair - kinda like how <foo> needs a </foo>, but in a different format. Essentially it is complaining that it found a </bar> instead (just: the xml is only a metaphor). The details are in the encoding specification, but the long and short is that one of:

    • 数据固有损坏(由于编码器故障造成损坏)或
    • 数据在阅读时变得腐败,或者
    • 数据没问题,你给出了一个有问题的解码器

    如果我不得不猜测,数据在传输过程中已经损坏 - 因为这太可怕了

    If I had to guess, the data has been damaged in transit - because that is so frighteningly common

更多推荐

协议消息端组标记与预期标记不匹配

本文发布于:2023-11-25 10:15:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629352.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标记   不匹配   协议   消息

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!