users@jersey.java.net

Error: Request entity is in a format not supported by the requested resource for the requested method

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Fri, 03 Apr 2009 16:22:01 -0400

Hi Guys,

This one is surely something really dumb that I am doing wrong...

I am just starting to add the create method for my resource. The create
RPC never makes it into my jersey annotated create method.
Instead Tomcat valve code seem to be returning the following error:

"The server refused this request because the request entity is in a
format not supported by the requested resource for the requested method"

I do not see a stacktrace anywhere.

Here is what my new method looks like:

    @Path("/create")
    @POST
    @Produces({"application/xml","application/json"})
    @Consumes({"application/xml","application/json"})
    public Response create(@FormParam("xsiType") String xsiType,
        @QueryParam("format") String format,
        MultivaluedMap<String, String> formParamsMulti) {
        ...
    }

This is my first POST method. Here is what the LoggingFilter output
looks like:

2 * In-bound request received
2 > POST http://localhost:8888/rest/create?format=application/json
2 > accept-encoding: gzip,deflate
2 > connection: keep-alive
2 > accept-charset: UTF-8,*
2 > pragma: no-cache
2 > content-type: application/x-www-form-urlencoded; charset=UTF-8
2 > keep-alive: 300
2 > content-length: 88
2 > cache-control: no-cache
2 > host: localhost:8888
2 > accept-language: en-us,en;q=0.5
2 > user-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US;
rv:1.7.12) Gecko/20050920
2 > accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2 >

Any idea what I am doing wrong? Thanks for any help.

-- 
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com