Type definition error: [simple type, class java.time.Instant]; nested exception is com.fasterxml.jac
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相关推荐
- 开发BUG | “Type definition error: [simple type, class com.example.mall.pojo.User];
今天用postman测试接口的时候遇到了这个错误 "Type definition error: [simple type, class com.example.mall.pojo.User ...
- type definition error
type definition error 报错信息 "msg": "Type definition error: [simple type, class com.ynt ...
- 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 ...
- 通俗易懂解释一类和二类错误(Type I Error Type II Error)
通俗易懂解释一类和二类错误(Type I Error Type II Error) 作者 KULDEEP PATEL 翻译自False Positive (Type I Error) and Fals ...
- java nested_Java 里的 nested exception 如何理解?
经常看到,但是不理解什么意思 比如这个: 2017-10-20 11:38:11,211 ERROR - Failed to convert value of type 'java.lang.Stri ...
- jboss5 启动时报HsqlException:length must be specified in type definition:VARBINARY错误
https://community.jboss.org/message/585994 EJBTimerService error on JBoss5 start up - without applic ...
- JsonMappingException:找不到类型[simple type,class]的合适构造函数:无法从JSON对象实例化
本文翻译自:JsonMappingException: No suitable constructor found for type [simple type, class ]: can not in ...
- XML——文档类型定义(DTD-Document Type Definition)
[0]README 0.1)本文文字描述转自 core java volume 2 , 旨在理解 XML--文档类型定义(DTD-Document Type Definition) 的基础知识: 0. ...
- 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 ...
最新文章
- 活动目录迁移之03奔向08 --10月18日2008系列讲座预告篇
- Sublime如何设置背景透明
- 架构 | 聊聊我心中的架构设计观
- 两个对象的 hashCode()相同,则 equals()也一定为 true,对吗?
- Servlet规范之Listener工作原理
- HTML输入=“文件”接受属性文件类型(CSV)
- 解决 Error:No suitable device found: no device found for connection System eth0
- 运行aspnet时要求启用windows集成身份验证
- p6spy oracle,p6spy简单使用
- android手机怎么改字体,手机字体怎么改 安卓手机字体修改教程
- 【MacOS】MacOS 添加虚拟打印机
- u盘重置后计算机不显示了,u盘在电脑上不显示了如何恢复
- 国际服务贸易重点整理
- 计算机键盘重复设置,电脑键盘错乱怎么恢复 一键快速重新设置电脑快捷键方法...
- 实习日记 08/23 day33 理解JVM---Java核心卷中的并发
- python模拟浏览器访问企查查_python爬虫另辟蹊径绕过企查查的登录验证,我太冇财了...
- 智能扫地机器人陀螺仪导航
- 《孙子兵法》十三篇注译(11--地形篇)
- 2022.11.27一周总结
- JVM-Java高墙之内存模型