问题描述:
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.itwang.domain.Customer]
原因分析:
springboot整合redis时报错,对象不能序列化
解决方案:
将对象实现 Serializable 接口
import java.io.Serializable;
public class Customer implements Serializable {
//***
}