【发布时间】:2019-06-09 14:37:54
【问题描述】:
我正在通过 REST 发送一个用户对象,其中包含一组 SimpleGrantedAuthority 对象。在接收方,我遇到了一个异常:
org.springframework.core.codec.DecodingException: JSON解码错误: 无法构造实例
org.springframework.security.core.authority.SimpleGrantedAuthority(尽管至少存在一个 Creator):不能从 Object 反序列化 值(无委托或基于属性的创建者);
我正在使用 Spring Boot 2.1.2 提供的默认 JSON 映射器。在接收端,我使用的是 WebFlux 的 WebClient(本例中为 WebTestClient)。
谁能向我解释为什么会出现此错误以及如何解决?
【问题讨论】:
标签: java spring jackson spring-webflux