[Jersey] _at_Consumes with JSONObject issue

From: sudhakar <>
Date: Thu, 14 Apr 2011 04:55:22 -0700 (PDT)


i am trying to post a JSonObject to REST Service,but i am not able to do
this.while i am running my client program i am getting following exception

com.sun.jersey.api.client.ClientHandlerException: A message body reader for
Java class net.sf.json.JSONObject, and Java type class
net.sf.json.JSONObject, and MIME media type, application/json, was not found

here is my restservice :


        import net.sf.json.JSONObject;

        public class Hello {

        public String processMessageObject(JSONObject obj) {
                   return ("Success");

here is my client program :

public class RestJerseyClient {
        public static void main(String[] args) {
             JSONObject obj=new JSONObject();
                obj.put("ToAddr", "to_at_tcs");
                obj.put("FromAddr", "from_at_tcs");
                        ClientConfig config = new DefaultClientConfig();
                       Client client = Client.create(config);
                        WebResource service = client.resource(getBaseURI());

                    System.out.println("JSON :
                catch(Exception e)

help me its very urgent

View this message in context:
Sent from the Jersey mailing list archive at