users@jersey.java.net

[Jersey] Re: jersey-proxy-client with 1.x and generic collection return types

From: Martin Matula <martin.matula_at_oracle.com>
Date: Mon, 16 Jul 2012 11:47:23 +0200

On 7/11/12 7:52 AM, Guy Rouillier wrote:
> However, I've been struggling (unsuccessfully) for two days now trying
> to get methods working that return generic collections. For example,
> with the following web service method:
>
> @GET
> @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
> @Path("listByProspectiveCustomer")
> public List<Contact>
> getProspectiveContactListByCustomer(@QueryParam("id") String customerId);
>
> The invocation gets to the server, and the server returns the result
> to the client. But then the client gets this error:
>
> Jul 10, 2012 11:21:26 PM com.sun.jersey.api.client.ClientResponse
> getEntity
> SEVERE: A message body reader for Java class java.util.List, and Java
> type interface java.util.List, and MIME media type application/xml was
> not found
> Jul 10, 2012 11:21:26 PM com.sun.jersey.api.client.ClientResponse
> getEntity
> SEVERE: The registered message body readers compatible with the MIME
> media type are:
> application/xml ->
> ....
>
> The list is pretty long so I'll leave it off. The example shows:
>
> @GET
> @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
> List<Book> getBooks();
>
> which is pretty much exactly what I have. So does the proxy client
> just not work with 1.x? If it should, how do I fix this?

This is now fixed in rev. 5753.
Martin