users@jersey.java.net

[Jersey] How can I parse a java.util.List<?>? Is it supported by the Jersey client?

From: JavaGeek_Boston <steven.boscarine_at_childrens.harvard.edu>
Date: Mon, 9 Feb 2009 19:42:38 -0800 (PST)

Hello All,
This is probably a stupid question, but how do I create services that return
lists? I've created a web service
        @GET
        @Path("tokens")
        public List<Token> foo(){
           //...return an ArrayList<Token>.
        }
It seems to work great from my browser. How can I parse it?

com.sun.jersey.api.client.ClientHandlerException: A message body reader for
Java type, class java.util.List, and MIME media type, application/xml, was
not found

I'm attempting to parse it with the following command:
(new Client()).resource(SERVER_URL).path(MY_PATH).get(List.class);

(new Client()).resource(SERVER_URL).path(MY_PATH).get(String.class); works,
returning the expected XML, ruling out a path issue.

Any help is greatly appreciated.

Thanks in Advance,
Steven
Harvard Children's Hospital Informatics Program
-- 
View this message in context: http://n2.nabble.com/How-can-I-parse-a-java.util.List%3C-%3E---Is-it-supported-by-the-Jersey-client--tp2300852p2300852.html
Sent from the Jersey mailing list archive at Nabble.com.