码上敲享录 > redis数据库常见问题 > 解决DefaultSerializer requires a Serializable payload but received an object of type[xxx]

解决DefaultSerializer requires a Serializable payload but received an object of type[xxx]

上一章章节目录下一章 2018-08-11已有12238人阅读 评论(0)

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.bx.cloud.common.auth.component.AuthSession]


解决方法:

对象xxx必须实现序列化,才能存储到Redis。如果没实现Serializable,控制台会报以上异常

public class AuthSession implements Serializable 

本文链接:http://www.yayihouse.com/yayishuwu/chapter/1467

3

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交