一.问题描述:
  在用redis做二级缓存时,出现如下异常

  DefaultSerializer requires a Serializable payload but received an object of type [model.Admin]

二.问题分析:
  要缓存的 Java 对象必须实现 Serializable 接口,因为 Spring 会将对象先序列化再存入 Redis

三.解决方法:
 将缓存实体类继承 Serializable

public class Admin implements Serializable

DefaultSerializer requires a Serializable payload but received an object of type [model.Admin]的更多相关文章

  1. Caused by: java.lang.IllegalArgumentException: DefaultSerializer requires a Serializable payload but received an object of type [VCodeModel]

    2019-08-20 17:53:24,054 [ERROR] [http-nio-8047-exec-1] [HttpResult.java : 143] 系统异常 org.springframew ...

  2. celery 4.1下报kombu.exceptions.EncodeError: Object of type 'bytes' is not JSON serializable 处理方式

    #python代码如下 from celery import Celeryimport subprocess app = Celery('tasks', broker='redis://localho ...

  3. Object of type 'ListSerializer' is not JSON serializable “listserializer”类型的对象不可JSON序列化

    Object of type 'ListSerializer' is not JSON serializable “listserializer”类型的对象不可JSON序列化 一般原因为 序列化的对象 ...

  4. TypeError: Object of type 'int64' is not JSON serializable

    错误类型:TypeError: Object of type 'int64' is not JSON serializable 错误场景:对Numpy和Pandas结果进行json.dumps报错 错 ...

  5. TypeError: Object of type 'int32' is not JSON serializable ——已解决

    将模型用flask封装,返回json时报错:TypeError: Object of type 'int32' is not JSON serializable 网上搜索出的解决方案:重写json.J ...

  6. labelme2coco问题:TypeError: Object of type 'int64' is not JSON serializable

    最近在做MaskRCNN 在自己的数据(labelme)转为COCOjson格式遇到问题:TypeError: Object of type 'int64' is not JSON serializa ...

  7. Object of type 'ndarray' is not JSON serializable

    Object of type 'ndarray' is not JSON serializable import numpy as np import json arr=np.asarray([345 ...

  8. TypeError: Object of type 'int32' is not JSON serializable

    将模型用flask封装,返回json时报错:TypeError: Object of type 'int32' is not JSON serializable 网上搜索出的解决方案:重写json.J ...

  9. Django+Celery+redis kombu.exceptions.EncodeError:Object of type is not JSON serializable报错

    在本文中例子中遇到问题的各种开发版本如下: Python3.6.8 Django==2.2 celery==4.4.0 kombu==4.6.7 redis==3.3.0 大概的报错如下截图: 是在开 ...

随机推荐

  1. $('div','li') 和 $('div , li') 和 $('div li') 区别

    $('div','li')是$(子,父),是从父节点里找子,而不是找li外面的div $('div , li')才是找所有的div和li,之间不存在父子关系 $('div li') 是找div里面所有 ...

  2. 随笔编号-04 AngularJS 相关小问题解决方案合集

    1  解决 Select选择框遍历时,出现一个空白选项: <select style="width: 20%;margin-left: 5px;height: 31px;" ...

  3. JVM参数配置&&命令工具

    JVM参数配置 大致方向:JVM调优的目的是保证在一定吞吐量的情况下尽可能的减少GC次数,从而减少系统停顿时间,提高服务质量和效率. 其中减少GC次数的原则: 将新生代转换成老年代的数量降至最少(及时 ...

  4. BS/CS 区别

    转载自:https://www.cnblogs.com/chenmingjun 一.CS和BS含义: CS即Client/Server(客户机/服务器)结构.C/S结构在技术上很成熟,它的主要特点是交 ...

  5. P2805 [NOI2009]植物大战僵尸 + 最大权闭合子图 X 拓扑排序

    传送门:https://www.luogu.org/problemnew/show/P2805 题意 有一个n * m的地图,你可以操纵僵尸从地图的右边向左边走,走的一些地方是有能量值的,有些地方会被 ...

  6. Numbers That Count POJ - 1016

    "Kronecker's Knumbers" is a little company that manufactures plastic digits for use in sig ...

  7. 爬虫反爬之代理IP

    爬虫反爬之代理IP 代理IP其实本就是在requests模块中的参数 定义: 代替原来的IP地址去对接网络的IP地址. 作用: 隐藏自身真实IP,避免被封. 获取代理IP网站 西刺代理.快代理.全网代 ...

  8. WebStorm调节控制台字体

    File --> Settings --> Editor --> Colors & Fonts --> Console Font

  9. 062 Python必备库-从Web解析到网络空间

    目录 一.概述 二.Python库之网络爬虫 2.1 Requests 2.2 Scrapy 2.3 pyspider 三.Python库之Web信息提取 3.1 Beautiful Soup 3.2 ...

  10. Git的使用(三)远程仓库添加及克隆

    Git是分布式版本控制系统,同一个Git仓库,可以分布到不同的机器上.怎么分布呢?最早,肯定只有一台机器有一个原始版本库,此后,别的机器可以“克隆”这个原始版本库,而且每台机器的版本库其实都是一样的, ...