一、该问题的重现步骤是什么?
bladeRedis.hIncrBy(key, hashKey, 2); // 第一次redis值为正常2
Integer value = redis.hGet(key, hashKey); // 取值报错,反序列化异常
// 堆栈信息如下:
java.lang.RuntimeException: Truncated.
at io.protostuff.IOUtil.mergeFrom(IOUtil.java:50)
at io.protostuff.ProtostuffIOUtil.mergeFrom(ProtostuffIOUtil.java:104)
at org.springblade.core.redis.serializer.ProtoStuffSerializer.deserialize(ProtoStuffSerializer.java:59)
at org.springframework.data.redis.core.AbstractOperations.deserializeHashValue(AbstractOperations.java:355)
at org.springframework.data.redis.core.DefaultHashOperations.get(DefaultHashOperations.java:55)
Caused by: io.protostuff.ProtobufException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.
at io.protostuff.ProtobufException.truncatedMessage(ProtobufException.java:76)
... 123 common frames omitted
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at io.protostuff.ByteArrayInput.readRawVarint32(ByteArrayInput.java:531)
at io.protostuff.ByteArrayInput.skipField(ByteArrayInput.java:179)
at io.protostuff.ByteArrayInput.handleUnknownField(ByteArrayInput.java:217)
at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:462)
at io.protostuff.IOUtil.mergeFrom(IOUtil.java:45)
... 122 common frames omitted
二、你期待的结果是什么?实际看到的又是什么?
期待 value 返回 2,实际报错
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
BladeX
四、请提供详细的错误堆栈信息,这很重要。
java.lang.RuntimeException: Truncated.
at io.protostuff.IOUtil.mergeFrom(IOUtil.java:50)
at io.protostuff.ProtostuffIOUtil.mergeFrom(ProtostuffIOUtil.java:104)
at org.springblade.core.redis.serializer.ProtoStuffSerializer.deserialize(ProtoStuffSerializer.java:59)
at org.springframework.data.redis.core.AbstractOperations.deserializeHashValue(AbstractOperations.java:355)
at org.springframework.data.redis.core.DefaultHashOperations.get(DefaultHashOperations.java:55)
Caused by: io.protostuff.ProtobufException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.
at io.protostuff.ProtobufException.truncatedMessage(ProtobufException.java:76)
... 123 common frames omitted
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at io.protostuff.ByteArrayInput.readRawVarint32(ByteArrayInput.java:531)
at io.protostuff.ByteArrayInput.skipField(ByteArrayInput.java:179)
at io.protostuff.ByteArrayInput.handleUnknownField(ByteArrayInput.java:217)
at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:462)
at io.protostuff.IOUtil.mergeFrom(IOUtil.java:45)
... 122 common frames omitted
五、若有更多详细信息,请在下面提供。
不止是 hIncrBy() 之后 hGet() 会报错,其他类型 incrBy() 都会报错
将序列化方式改为JDK序列化,同样报错,仅堆栈信息不一致
blade.redis.serializer-type=JDK
- 热议问题
-
腾讯SMS相关
1
-
表格滚动条宽度调整问题
1
-
物模型如果存在模块分组,会导致获取不到缓存获取物模型的数据类型
1
-
@saber node仓库突然无法访问
1
-
疑似TOKEN过期后端未进行处理
1
-
登录时候报错,Could not initialize class org.xnio.
1
-
物联网设备连接以及上报信息问题
1
-
cloud版本,接口放行不生效
2
-
4.4微服务版本单元测试提示Unable to find a @SpringBootConfiguration找不到
1
-
一级菜单页面不跳转,提示页面不存在,把一级菜单换成二级菜单可以正常跳转
2
扫一扫访问 Blade技术社区 移动端