users@jersey.java.net

Trouble accessing resource

From: Rod Fitzsimmons Frey <rfrey_at_attassa.com>
Date: Mon, 23 Mar 2009 14:59:19 -0600

I don't even know how to correctly frame this question, so I'm hoping
somebody has seen a similar symptom and can point me in the right
direction. Failing that, a pointer or two on how to debug would be
greatly appreciated.

I have a simple resource for accessing and creating users.
UsersResource has a post method:

     @POST
     @Consumes("application/x-www-form-urlencoded")
     @Produces("application/xml")
     public Response post(@FormParam("email") String email,
@FormParam("password") String password) {
         log.log(Level.INFO, "Creating a user: " + email);
..etc

Here's the issue: when I deploy this class and call the POST with a
curl command, it gets called... until I restart the server. Then the
call returns a 201 Created, but my class doesn't get called. I can
get it to go again by modifying the size of the UsersResources.class
file (just a touch doesn't work): then it will get called successfully
again until I restart the server.

A filter I have in place is getting called consistently in both cases.

I'm running Jersey bundle 1.0 on Tomcat 6.0.18.

AFAIK the default return value should be a 401 if Jersey isn't finding
a resource class, or 204 No Content for null content. I'm getting
neither of those, rather a 201. Plus that log statement in the first
line of the post method is never called.

I'm truly perplexed. Any hints?

Rod