[Jersey] Re: Message Body Writer

From: Rimy Sfm <>
Date: Wed, 13 Apr 2011 05:56:34 -0700 (PDT)

I'm sorry I posted a wrong method declaration. Actually the method causin me
the problem takes 2 integer as paramerter:

        public Integer add(@FormParam("a") Integer a, @FormParam("b")Integer b)
                return a+b;

and this is the part of my client code whre I invoke it:

                                MultivaluedMapImpl formDataInt = new MultivaluedMapImpl();
                                        formDataInt.add("a", 2);
                                        formDataInt.add("b", 3);
                                        ClientResponse responseInt =
                                        String entityInt = responseInt.getEntity(String.class);
                                        System.out.println (responseInt);
                                        System.out.println (entityInt);

And when I run my server I get this error:

GRAVE: Mapped exception to response: 500 (Internal Server Error) com.sun.jersey.api.MessageException: A
message body writer for Java class java.lang.Integer, and Java type class
java.lang.Integer, and MIME media type application/octet-stream was not

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