`
m635674608
  • 浏览: 5042216 次
  • 性别: 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是该字段的数据类型,所有如果我们改变了业务对象类中字段的顺序,或者改变了字段的类型,都会出现反序列化失败;

分享到:
评论

相关推荐

    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...

    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 ...

    iOS Fuondation Framework Reference

    - `- (NSData *)data`: Returns the data contained in the descriptor. - `- (id)objectValue`: Returns the object value of the descriptor if it can be represented as an Objective-C object. **Constants**:...

    Nonlinear Optics

    "This book is a well-written and successfully tested text useful for a course on An Introduction to Nonlinear Optics. It is also a fairly self-contained book. I recommend this book for classroom ...

    Unit-18-Fluid-and-Hydraulic-System-机电专业英语-图文课件.ppt

    31. **self-contained**:独立的,自成一体的,形容能够独立运作的液压系统。 32. **stimulate**:促进,激励,可以指液压系统对机械设备的作用。 33. **hydraulics**:水力学,研究液体静力学和动力学的科学。 34. ...

    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 ...

    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/...

    xmlpull_1_0_5解决 org/xmlpull/v1/XmlPullParserException

    XMLPull是XML解析的一种轻量级、高性能的API,它允许开发者在没有DOM(文档对象模型)或SAX(简单API for XML)解析器的情况下处理XML文档。在Android开发中,由于DOM和SAX解析器内存消耗较大,XMLPull成为了处理XML...

    EMC Unisphere Client 1.3.8.1.0119

    EMC Unisphere Client 1.3.8.1.0119 是一款专为管理EMC硬件存储系统设计的客户端工具,它提供了强大的功能,让用户可以通过Web界面进行高效、安全的本地或远程操作。Unisphere是EMC公司提供的一个核心存储管理解决...

    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 ...

    ILI9331AN_V0.2.pdf

    Based on the given information from "ILI9331AN_V0.2.pdf," we can extract several key points related to the ILI9331 a-Si TFT LCD single chip driver, which supports a resolution of 240RGBx320 and 262K ...

    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 ...

    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 ...

    .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 ...

    win8风格图表大全.ppt

    37. **Contained Database Authentication**:独立数据库身份验证,减少对全局服务器级别的依赖。 38. **SharePoint Active Directory Support**:SharePoint与Active Directory的集成,简化用户身份验证。 39. **...

    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 ...

Global site tag (gtag.js) - Google Analytics