redis缓存获取数据报反序列化异常

Blade 未结 1 2268
263778608
263778608 剑圣 2020-10-20 15:25

一、该问题的重现步骤是什么?

  1. 使用usercache获取用户缓存信息报异常

    image.png



二、你期待的结果是什么?实际看到的又是什么?

期待正常获取用户缓存信息

实际看到

org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.StreamCorruptedException: invalid stream header: 0BFA0727

at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:84)

at org.springframework.data.redis.serializer.DefaultRedisElementReader.read(DefaultRedisElementReader.java:48)

at org.springframework.data.redis.serializer.RedisSerializationContext$SerializationPair.read(RedisSerializationContext.java:226)

at org.springframework.data.redis.cache.RedisCache.deserializeCacheValue(RedisCache.java:260)

at org.springframework.data.redis.cache.RedisCache.lookup(RedisCache.java:94)

at org.springframework.cache.support.AbstractValueAdaptingCache.get(AbstractValueAdaptingCache.java:58)

at org.springblade.core.cache.utils.CacheUtil.get(CacheUtil.java:188)

at org.springblade.core.cache.utils.CacheUtil.get(CacheUtil.java:168)

at org.springblade.system.user.cache.UserCache.getUser(UserCache.java:67)

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladex2.6.0   windows/linux都出错

四、请提供详细的错误堆栈信息,这很重要。

org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.StreamCorruptedException: invalid stream header: 0BFA0727

at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:84)

at org.springframework.data.redis.serializer.DefaultRedisElementReader.read(DefaultRedisElementReader.java:48)

at org.springframework.data.redis.serializer.RedisSerializationContext$SerializationPair.read(RedisSerializationContext.java:226)

at org.springframework.data.redis.cache.RedisCache.deserializeCacheValue(RedisCache.java:260)

at org.springframework.data.redis.cache.RedisCache.lookup(RedisCache.java:94)

at org.springframework.cache.support.AbstractValueAdaptingCache.get(AbstractValueAdaptingCache.java:58)

at org.springblade.core.cache.utils.CacheUtil.get(CacheUtil.java:188)

at org.springblade.core.cache.utils.CacheUtil.get(CacheUtil.java:168)

at org.springblade.system.user.cache.UserCache.getUser(UserCache.java:67)

五、若有更多详细信息,请在下面提供。

1条回答
  • 序列化和反序列化要一致。

    0 讨论(2)
提交回复