获取redis缓存反序列化问题

Blade 未结 5 2809
mokeycode
mokeycode 2020-10-15 11:55

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

  1. 使用DictCache获取缓存失败,报错如下:


  2. 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: 0B4A03E7
    at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:84)

  3、为什么系统会去使用

JdkSerializationRedisSerializer做反序列化。

4、当我把redis缓存手动删除后,获取缓存正常,过段时间又报以上反序列化问题
5条回答
提交回复