users@jersey.java.net

[Jersey] Jersey Client ClientHandlerException for List

From: aloleary <alanoleary_at_gmail.com>
Date: Mon, 27 Apr 2009 08:05:14 -0700 (PDT)

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-tp2726605p2726605.html
Sent from the Jersey mailing list archive at Nabble.com.