读取redis数据报no such class found

前提:在Redis中保存的键值对格式为:<key,实体类对象>

问题:读取redis数据报no such class found

org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Could not resolve type id '你的类路径' into a subtype of [simple type, class java.lang.Object]: no such class found

原因:之前在Redis中存储的实体类对象的包路径发生了变更,比如原来是com.vo.XxxVo;后来XxxVo的包路径改为了com.vo.test.XxxVo,这样就导致了如上的序列化异常。

解决办法:删除Redis中原来的数据,重新添加就好了,或者你再把包路径变回去都可以

猜你喜欢

转载自blog.csdn.net/gaoshan12345678910/article/details/129302506