springboot整合redis时报错

阅读 126

2022-05-02

org.springframework.data.redis.serializer.SerializationException: Cannot serialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using DefaultSerializer; nested exception is java.lang.IllegalArgumentException: DefaultSerializer requires a Serializable payload but received an object of type [com.example.springboot11.entiy.User]

原因是 com.example.springboot11.entiy.User 不能序列化
实体类实现 Serializable 接口就可以了
在这里插入图片描述

精彩评论(0)

0 0 举报