users@jersey.java.net

Re: [Jersey] Jersey Client ClientHandlerException for List

From: aloleary <alanoleary_at_gmail.com>
Date: Mon, 27 Apr 2009 09:09:35 -0700 (PDT)

Sorry epic fail on my part

com.sun.jersey.api.client.Client != com.mycompany.blah.Client

Using the "correct" client work... sometimes Netbeans "Fix Imports" is not
what you want ;-)

-A-



aloleary wrote:
>
> Hello,
> I have seen the solution to this problem as using the GenericType but I
> still get this error.
>
> 1) Exception:
>
> com.sun.jersey.api.client.ClientHandlerException: A message body reader
> for Java type, interface java.util.List, and MIME media type,
> application/json, was not found
>
> 2) Code
>
> public List<Client> getClientsJson() {
> return webResource.path("rest/client/page")
> .queryParam("max", "200")
> .header(AUTHENTICATION_HEADER, authentication)
> .accept(MediaType.APPLICATION_JSON_TYPE)
> .get(new GenericType<List<Client>>() {
> });
> }
>
> 3) Notes:
> This happens for my getClientsXML as well. I had expected ".get(new
> GenericType<List<Client>>()" to fix the issue...
>
> Any thoughts comments appreciated.
>
>

-- 
View this message in context: http://n2.nabble.com/Jersey-Client-ClientHandlerException-for-List-tp2726605p2726950.html
Sent from the Jersey mailing list archive at Nabble.com.