这是java redis反序列化问题

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 
org.springframework.core.NestedIOException:
 Failed to deserialize object type; 
nested exception is java.lang.ClassNotFoundException: com.wlh.pub.redis.entity.UserEntity

项目刚引入 Redis时是可以运用的,后来因为突然发现用不了了,其实仔细看了一下最后一行报的错  找不到这个com.wlh.pub.redis.entity.UserEntity 实体类,此时我项目确实没有这个类,这是在整合代码时,把这个实体类,路径改变了,redis 缓存的路径还在,只需清一下redis缓存

打开redis-cli.exe

 输入 dbsize  查看数据库长度(大小)

输入flushall   完全删除

输入 keys * 查看所有 redis 的 key

再次输入  dbsize 发现此时长度已为0  删除干净

 

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐