一.问题描述:
  在用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. Spring源码剖析4:其余方式获取Bean的过程分析

    原型Bean加载过程 之前的文章,分析了非懒加载的单例Bean整个加载过程,除了非懒加载的单例Bean之外,Spring中还有一种Bean就是原型(Prototype)的Bean,看一下定义方式: 1 ...

  2. python+unittest框架第四天unittest之批量执行案例

    今天开始批量执行用例~,场景是这样的: 工作中我们可能有多个模块文件(.py)这些文件根据不同的业务类型或功能,测试案例分布在不同的模块文件下.前面的小示例中,我们的测试用例都是在一个文件中,直接运行 ...

  3. 简析 Golang net/http 包

    net/http 包涵盖了与 HTTP 请求发送和处理的相关代码.虽然包中定义了大量类型.函数,但最重要.最基础的概念只有两个:ServeMux 和 Handler. ServeMux 是 HTTP ...

  4. Salesforce LWC学习(五) LDS & Wire Service 实现和后台数据交互 & meta xml配置

    之前的几节都是基于前台变量进行相关的操作和学习,我们在项目中不可避免的需要获取数据以及进行DML操作.之前的内容中也有提到wire注解,今天就详细的介绍一下对数据进行查询以及DML操作以及Wire S ...

  5. Hello World 之旅

    本文记录对于下面 `hello.c` 程序在 Linux 上一次运行系统所发生的事情,内容来源于 CSAPP 第一章. #include <stdio.h> int main(int ar ...

  6. NLP(九) 文本相似度问题

    多个维度判别文本之间相似度 情感维度 Sentiment/Emotion 感官维度 Sense 特定词的出现 词频 TF 逆文本频率 IDF 构建N个M维向量,N是文档总数,M是所有文档的去重词汇量 ...

  7. POJ-3169 Layout (差分约束+SPFA)

    POJ-3169 Layout:http://poj.org/problem?id=3169 参考:https://blog.csdn.net/islittlehappy/article/detail ...

  8. Gym 100851 Distance on Triangulation

    题意:给你一个N边形, 然后这个n边形有n-3条边,然后询问2点之间的最短路. 题解:分治. 我们可以找到一条边,使得这幅图能分成大小相同的2幅图,那么我们就可以确定那些被分割开的询问的答案是多少了. ...

  9. 杭电多校第九场 hdu6425 Rikka with Badminton 组合数学 思维

    Rikka with Badminton Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/O ...

  10. 关闭Linux(Ubuntu)错误报告

    关于错误报告 网上查了下,Ubuntu(包括elementary,elementary是基于Ubuntu的)桌面版预装了Apport,它是一个错误收集系统,会收集软件崩溃.未处理异常和其他,包括程序b ...