users@jersey.java.net

[Jersey] Deserializing JSON using jersey-client

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Sun, 20 Mar 2011 19:47:43 -0700 (PDT)

Hi,

I'm running into problems deserializing a JSON response using jersey-client.
The resource defines the following method:

        @GET
        @Produces(MediaType.APPLICATION_JSON + "; version=1.0")
        public List getClinics()

The client runs the following code:

                List result = resource().accept(MediaType.APPLICATION_JSON + ";
version=1.0").get(new GenericType&lt;List&lt;URI&gt;>()
                {
                });

And Jersey throws the following exception:

               SEVERE: A message body reader for Java class java.util.List,
and Java type java.util.List, and MIME media type application/octet-stream
was not found

I understand that Jersey is translating List to application/octet-stream in
spite of the fact that I specified accept() with a different mime type.
Jackson is serializing List to JSON on the server-side for me. How do I get
it to deserialize the JSON back into List?

Thank you,
Gili

--
View this message in context: http://jersey.576304.n2.nabble.com/Deserializing-JSON-using-jersey-client-tp6191049p6191049.html
Sent from the Jersey mailing list archive at Nabble.com.