postman调用接口报错

“type”: “https://www.jhipster.tech/problem/problem-with-message”,
“title”: “Internal Server Error”,
“status”: 500,
“detail”: “Type definition error: [simple type, class java.time.Instant]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of java.time.Instant (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value (‘2020-03-19 11:02:58’)\n at [Source: (PushbackInputStream); line: 3, column: 18] (through reference chain: com.cplh.gis.service.dto.ProcessFlowDTO[“createdDate”])”,
“path”: “/api/processFlow”,
“message”: “error.http.500”

原因是实体类继承AbstractAuditingEntity审计功能,其中的createdDate和lastModifiedDate字段是Instant类型的,json对其进行序列化和反序列化会报错。

解决办法

在审计类的字段加上@JsonIgnore注解就解决了。

更新一下:::
还有一种情况:
实体类的DTO没有实现序列化,

Type definition error: [simple type, class java.time.Instant]; nested exception is com.fasterxml.jac相关推荐

  1. 开发BUG | “Type definition error: [simple type, class com.example.mall.pojo.User];

    今天用postman测试接口的时候遇到了这个错误 "Type definition error: [simple type, class com.example.mall.pojo.User ...

  2. type definition error

    type definition error 报错信息 "msg": "Type definition error: [simple type, class com.ynt ...

  3. Unknown integral data type for ids : java.lang.String; nested exception is org.hibernate.id.Identifi

    1.发生的异常内容: org.springframework.orm.hibernate5.HibernateSystemException: Unknown integral data type f ...

  4. 通俗易懂解释一类和二类错误(Type I Error Type II Error)

    通俗易懂解释一类和二类错误(Type I Error Type II Error) 作者 KULDEEP PATEL 翻译自False Positive (Type I Error) and Fals ...

  5. java nested_Java 里的 nested exception 如何理解?

    经常看到,但是不理解什么意思 比如这个: 2017-10-20 11:38:11,211 ERROR - Failed to convert value of type 'java.lang.Stri ...

  6. jboss5 启动时报HsqlException:length must be specified in type definition:VARBINARY错误

    https://community.jboss.org/message/585994 EJBTimerService error on JBoss5 start up - without applic ...

  7. JsonMappingException:找不到类型[simple type,class]的合适构造函数:无法从JSON对象实例化

    本文翻译自:JsonMappingException: No suitable constructor found for type [simple type, class ]: can not in ...

  8. XML——文档类型定义(DTD-Document Type Definition)

    [0]README 0.1)本文文字描述转自 core java volume 2 , 旨在理解 XML--文档类型定义(DTD-Document Type Definition) 的基础知识: 0. ...

  9. Json转对象失败:No suitable constructor found for type [simple type, class com.test.faster.domain.respons

    今天自己定制一个json转换对象的方法,转换过程中报错: "No suitable constructor found for type [simple type, class com.te ...

最新文章

  1. 汪劲:生命系统中的非平衡物理学
  2. leetcode算法题--摆动序列★
  3. 中国工程院2019年院士增选第二轮候选人名单公布 李彦宏落选
  4. 一文搞定时间复杂度和空间复杂度
  5. Ajax系列之三:UpdatePanel
  6. 数据库设计(三)概念数据模型
  7. dicom格式怎么转换_QQ音乐下载的歌曲怎么转换MP3?音频转换格式详细教程
  8. codeforces1453 E. Dog Snacks
  9. Qt工作笔记-各种构造函数汇总以及运算符重载(入门必备)
  10. 选择合适的方法调试程序
  11. (八)用于人脸识别的Web API
  12. 清华镜像源_Hyperledger Fabric2.x Docker镜像编译加速
  13. CentOS + PyCharm 环境下使用 LIBSVM(及 unresolved reference 问题的解决)
  14. 商业智能BI有哪些数据价值
  15. [小甲鱼]汇编语言笔记 基础知识
  16. 1.2 几个经典博弈模型(囚徒的困境、赌胜博弈、产量决策的古诺模型)
  17. 【Windows】安装win10虚拟机
  18. 图片压缩工具ImageOptim
  19. 智和网管平台SugarNMS政府部门综合网管
  20. 程序员,你以为你很优秀,但却面试屡屡失败?

热门文章

  1. ddl语句(数据库ddl语句)
  2. [POJ1300]Door Man 做题笔记
  3. 随机生成数——C语言
  4. 火影忍者ol HTML5,火影忍者OL忍者考试50层全职业攻略
  5. oracle程序包写法,Oracle学习笔记20150913pl/sql编程包的写法
  6. ibatis.builder.BuilderException: Error parsing Mapper XML: Could not resolve type alias ‘XXX‘
  7. Linux CPU亲缘性详解
  8. 计算机专业实习的重要性
  9. 每个人背后都会有人在默默注视着你,所以很幸福
  10. 百度语音识别APP_ID/API_KEY/SECRET_KEY