【发布时间】:2017-02-28 00:59:06
【问题描述】:
我有一个使用 JAX-RS 客户端 API 调用服务的测试方法。当我运行这段代码时:
Response response = target.request(MediaType.APPLICATION_JSON).get();
List<Thing> list = response.readEntity(new GenericType<List<Thing>>() {});
我收到此错误:
Unable to find a MessageBodyReader of content-type application/json and type interface java.util.List
我已正确配置了 jersey-media-json-jackson 依赖项(它由我正在调用的服务使用),并且该项目在 WildFly 10 上运行。
我错过了什么吗?
【问题讨论】:
标签: json jackson jax-rs jersey-client