users@jersey.java.net

sub-resource method not recognized (405)

From: David Hummel <lemmuh_at_gmail.com>
Date: Thu, 1 Apr 2010 13:53:57 -0400

Greetings!

I have the following resource class:

@Path("class")
public class ClassResource
{
    @GET
    public Response selectClasses(/* some query params here */)
    {
       ...
       return selectClasses(search);
    }

    @POST
    public Response selectClasses(final ClassSearch search)
    {...}

    @GET
    @Path("user")
    public Response selectClassesByUserId(/* some query params here */)
    {
       ...
       return selectClassesByUserId(search);
    }

    @POST
    @Path("user")
    public Response selectClassesByUserId(final ClassSearch search)
    {...}

    @GET
    @Path("{id}")
    public Response selectClass(/* path param here */)
    {...}
}

When I attempt to GET or POST at the URIs of the sub-resource methods
(.../class/user), I receive a 405:

The specified HTTP method is not allowed for the requested resource ().

According to the spec it appears that this should work. Any ideas
what might be happening here?

I'm using jersey-server 1.1.5.1 on Tomcat 6.

Thanks!

David Hummel