ClientHandlerException,包含特殊内容类型的泽西请求

时间:2015-03-04 09:19:28

标签: java json jersey jackson content-type

我正在尝试发布此内容类型的请求:application / x-poh-ws-8-call + json

我正在做这样的事情:

ClientResponse resp;

resp = webResource.header(HttpHeaders.AUTHORIZATION, neededAuthorizationHeader)
                 .header(HttpHeaders.CONTENT_TYPE, "application/x-poh-ws-8-call+json")
                .accept(MediaType.APPLICATION_JSON_TYPE).post(ClientResponse.class, request);

这是例外

com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class net.awl.occ.client.models.requests.parameters.occ.ListTransfersRequest, and MIME media type, application/x-poh-ws-8-call+json, was not found

我正在使用像这样的JacksonJaxbJsonProvider

JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();
provider.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);

我是否必须为此内容类型创建一个特殊的提供程序?

谢谢

0 个答案:

没有答案