`
m635674608
  • 浏览: 4931954 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

com.dyuproject.protostuff.ProtobufException: Protocol message contained an inval

 
阅读更多
log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.IllegalStateException: Reading from a byte array threw an IOException (should never happen).
	at com.cmall.redis.utils.RedisSeriUtils.deserialize(RedisSeriUtils.java:51)
	at com.cmall.redis.dao.JedisClusterDao.jhget(JedisClusterDao.java:78)
	at com.cmall.redis.service.impl.RedisClusterServiceImpl.hget(RedisClusterServiceImpl.java:49)
	at com.artbulb.redis.BaseJedisApp.main(BaseJedisApp.java:46)
Caused by: java.lang.RuntimeException: Reading from a byte array threw an IOException (should never happen).
	at com.dyuproject.protostuff.IOUtil.mergeFrom(IOUtil.java:52)
	at com.dyuproject.protostuff.ProtostuffIOUtil.mergeFrom(ProtostuffIOUtil.java:96)
	at com.cmall.redis.utils.RedisSeriUtils.deserializeInternal(RedisSeriUtils.java:112)
	at com.cmall.redis.utils.RedisSeriUtils.deserialize(RedisSeriUtils.java:46)
	... 3 more
Caused by: com.dyuproject.protostuff.ProtobufException: Protocol message contained an invalid tag (zero).
	at com.dyuproject.protostuff.ProtobufException.invalidTag(ProtobufException.java:98)
	at com.dyuproject.protostuff.ByteArrayInput.readFieldNumber(ByteArrayInput.java:220)
	at com.dyuproject.protostuff.runtime.MappedSchema.mergeFrom(MappedSchema.java:188)
	at com.dyuproject.protostuff.runtime.ObjectSchema.readObjectFrom(ObjectSchema.java:627)
	at com.dyuproject.protostuff.runtime.ObjectSchema.mergeFrom(ObjectSchema.java:312)
	at com.dyuproject.protostuff.ByteArrayInput.mergeObjectEncodedAsGroup(ByteArrayInput.java:390)
	at com.dyuproject.protostuff.ByteArrayInput.mergeObject(ByteArrayInput.java:362)
	at com.dyuproject.protostuff.runtime.RuntimeUnsafeFieldFactory$15$1.mergeFrom(RuntimeUnsafeFieldFactory.java:921)
	at com.dyuproject.protostuff.runtime.MappedSchema.mergeFrom(MappedSchema.java:196)
	at com.dyuproject.protostuff.IOUtil.mergeFrom(IOUtil.java:43)
	... 6 more

 

三、使用Java源码过程中报错

  1. 解析时报错:Protocol message tag had invalid wire type 异常 
    原因:二进制的内容不能直接在http协议传输,传输的内容可能有压缩或者base64编码,需要对接收到的二进制数据做解压缩或者base64解码。
  2. 解析式报错:Protocol message contained an invalid tag (zero) 
    原因:待解析的二进制数据中不全是pb二进制数据,可能还有其它内容,例如二进制数据头部约定的错误信息长度、错误信息字符串内容等。

 

原因:字段变动

少字段,或者字段顺序发生变化,(并且该字段有值)则会报此异常!

fieldNumber每个字段的标号,wire_type是该字段的数据类型,所有如果我们改变了业务对象类中字段的顺序,或者改变了字段的类型,都会出现反序列化失败;

分享到:
评论

相关推荐

    Java registry,com.ice.jni.registry

    Files contained in registry-3.1.3.jar: META-INF/MANIFEST.MF com.ice.jni.registry.RegMultiStringValue.class com.ice.jni.registry.RegBinaryValue.class com.ice.jni.registry.RegistryException.class ...

    Android ZXing1.6核心类库(core.jar)

    Files contained in zxing-1.6-core.jar: META-INF/MANIFEST.MF com.google.zxing.BarcodeFormat.class com.google.zxing.Binarizer.class com.google.zxing.BinaryBitmap.class ...

    WaveletTheoryAnElementaryApproachwithApplications.PDF

    A self-contained, elementary introduction to wavelet theory and applications Exploring the growing relevance of wavelets in the field of mathematics, Wavelet Theory: An Elementary Approach with ...

    Computing with Data: An Introduction to the Data Industry

    Computing with Data: An Introduction to the Data Industry By 作者: Guy Lebanon – Mohamed El-Geish ISBN-10 书号: 331998148X ISBN-13 书号: 9783319981482 Edition 版本: 1st ed. 2018 出版日期: 2018-11-29 ...

    .net的矛与盾 软件保护与软件破解程序源代码(收集reflector最全插件,大部分有源代码)

    18.BizTalkDisassembler: Allows you to list all BizTalk artifacts contained in an assembly and extract them. 19. DependencyStructureMatrix: Allows you to create and browser dependency structure ...

    Debugging Malloc Lab: Detecting Memory-Related Errors

    The usual implementation of malloc and free are unforgiving to errors in their callers' code, including cases where the programmer overflows an array, forgets to free memory, or frees a memory block ...

    saxon9-dom.jar

    Files contained in saxon9-dom.jar: META-INF/MANIFEST.MF net.sf.saxon.dom.AttrOverNodeInfo.class net.sf.saxon.dom.DOMAttributeMap.class net.sf.saxon.dom.DOMEnvelope.class ...

    Java邮件开发Fundamentals of the JavaMail API

    stands for Internet Message Access Protocol, and is currently in version 4, also known as IMAP4. When using IMAP, your mail server must support the protocol. You can't just change your program to ...

    Error Correction coding——mathematical methods and algorithms

    Error Correction Coding - Mathematical Methods and Algorithms (Source Files Contained).pdf Error Correction Coding Mathematical Methods and Algorithms Todd K. Moon Utah State University @ E ! C I E N...

    iOS.8.App.Development.Essentials

    iOS 8 App Development Essentials takes a modular approach to the subject of iOS 8 application development for both the iPhone and iPad, with each chapter covering a self contained topic area ...

    apt-mirror-api-0.1.jar

    Files contained in apt-mirror-api-0.1.jar: META-INF/MANIFEST.MF META-INF/maven/com.moparisthebest.aptIn16/apt-mirror-api/pom.properties META-INF/maven/...

    PDF 1.7 format

    NOTICE: All information contained herein is the property of Adobe Systems Incorporated. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, ...

    an introduction to be the theory of canonical matrices turnbull-matrices.djvu

    Thorough and self-contained, this penetrating study of the theory of canonical matrices presents a detailed consideration of all the theory’s principal features. Topics include elementary ...

    contained.af, 用于学习容器,功能和系统系统的愚蠢游戏.zip

    contained.af, 用于学习容器,功能和系统系统的愚蠢游戏 contained.af 用于学习容器,功能和系统信息库的游戏。添加问题编辑这里 file: frontend/js/questions.js 。在本地运行 contained.af包含的组件由以下几个...

    RLS.zip_RLS—like_channel Equalization_equalization_motor_rls s f

    Here is a list of the files contained in RLS.zip FIR_RLS : FIR RLS demo (FIR is used when there is an access to the output i.e feedback is used like in a dc motor we use speed as feedback) IIR_RLS : ...

    javax.jms.jar

    Classes contained in javax.jms.jar: javax.transaction.xa.XAResource.class javax.jms.BytesMessage.class javax.jms.Message.class javax.jms.JMSException.class javax.jms.Destination.class javax.jms....

    javax.persistence.jar

    Files contained in javax.persistence.jar: META-INF/MANIFEST.MF javax.persistence.Access.class javax.persistence.AccessType.class javax.persistence.AssociationOverride.class javax.persistence....

    [Apress.J2EE系列].Apress.Pro.JSP.2.4th.Edition.Dec.2005

    Pro JSP 2, Fourth Edition ...or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com in the Source Code section.

    Magic Packet(TM)

    Associates each group of workstations/hosts to an alarm clock, and power on each group when the time comes. This utility supports the Microsoft Windows NT 4.0 and Windows 95 operating system ...

Global site tag (gtag.js) - Google Analytics