Type definition error: [simple type, class xxx.xxx.xxx]; nested exception is com.fasterxml.jackson.d

59 篇文章 0 订阅
39 篇文章 1 订阅

Type definition error: [simple type, class xxx.xxx.xxx]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of xxx.xxx.xxx (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information





这个错误是因为 Jackson 试图将 JSON 数据反序列化为 XXX类的实例,但是 XXX是一个接口或抽象类,Jackson 不知道应该实例化哪个具体的类。

一种解决方法是创建一个 XXX 的具体实现类,并告诉 Jackson 使用这个类来反序列化 JSON 数据。你可以使用 @JsonDeserialize 注解来实现这个目标。

@JsonDeserialize(as = MyXXX .class)
public interface XXX{
    // ...
}

public class MyXXX implements XXX{
    // 实现 HistoricProcessInstance 接口的方法
}






我的Github地址,欢迎大家加入我的开源项目,或者(在我的主页联系我)加入你们的开源项目,点点Github-Stars。

\开源项目名称依赖类型版本号描述
1spring-boot-starter-triepom1.0.0-SNAPSHOT特定需求下查询速度远超开源检索工具,innodb下B+树或者ES中倒排索引无法与之比拟.
2spring-boot-starter-triejar1.0.0-M1提供了基于SpringCloud的服务节点,可以通过Nacos注册中心进行服务发现,实现了树的动态扩容与缩容,以及服务的动态上下线。
3Data-Providerpom1.0.0-SNAPSHOT提供了多种数据源的查询,以及数据的类型同步,作为一个Jar可以依赖在其他服务上动态的提供数据。
  • 8
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一只小小狗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值