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. 活动目录迁移之03奔向08 --10月18日2008系列讲座预告篇
  2. Sublime如何设置背景透明
  3. 架构 | 聊聊我心中的架构设计观
  4. 两个对象的 hashCode()相同,则 equals()也一定为 true,对吗?
  5. Servlet规范之Listener工作原理
  6. HTML输入=“文件”接受属性文件类型(CSV)
  7. 解决 Error:No suitable device found: no device found for connection System eth0
  8. 运行aspnet时要求启用windows集成身份验证
  9. p6spy oracle,p6spy简单使用
  10. android手机怎么改字体,手机字体怎么改 安卓手机字体修改教程
  11. 【MacOS】MacOS 添加虚拟打印机
  12. u盘重置后计算机不显示了,u盘在电脑上不显示了如何恢复
  13. 国际服务贸易重点整理
  14. 计算机键盘重复设置,电脑键盘错乱怎么恢复 一键快速重新设置电脑快捷键方法...
  15. 实习日记 08/23 day33 理解JVM---Java核心卷中的并发
  16. python模拟浏览器访问企查查_python爬虫另辟蹊径绕过企查查的登录验证,我太冇财了...
  17. 智能扫地机器人陀螺仪导航
  18. 《孙子兵法》十三篇注译(11--地形篇)
  19. 2022.11.27一周总结
  20. JVM-Java高墙之内存模型

热门文章

  1. java实习生内心独白
  2. 身份证阅读器Android版
  3. 判断单链表L是否递增
  4. 一个逗比web前端的理想
  5. 戴尔外星人电脑原厂Windows 10版本镜像制作安装
  6. ST的芯片是怎么变成“渣男”的?
  7. 阿里巴巴2015秋招算法类机试题目(三阶魔方)
  8. 分布式全局唯一id实现-2 springCloud-MyBatis-Plus集成百度分布式全局id(uid-generator)
  9. 大疆无人机安卓开发一步步
  10. redis 查看key的有效期_redis key的过期时间