DefaultSerializer requires a Serializable payload but received an object of type...

时间:2025-02-17 17:34:26

1,项目最近改了点东西,今天往redis缓存里存入内容时报错了,如下:

Failed to serialize object using DefaultSerializer; 
nested exception is : DefaultSerializer 
requires a Serializable payload but received an object of type []

2,查找资料才发现上面要缓存的对象没有实现 Serializable接口,果然实现Serializable接口后就不报错了

public class UserInfoPo extends BasePo implements Serializable {
}