users@jersey.java.net

[Jersey] Inconsistent REST endpoint with the same name and different HTTP methods

From: Behrooz Nobakht <nobeh5_at_gmail.com>
Date: Thu, 19 Sep 2013 14:46:12 +0200

Hello,

We have a situation in two of our environments that are using Jersey 1.12.
There is a REST endpoint with the same name and different HTTP method such
as:

@Path("debug/op)
@GET
public Response doGetOperation() {}

@Path("debug/op")
@POST
public Response doPostOperation() {}

Both of the environments are running the same version of the code on Java
1.7.0_05. Trying standard “/app/application.wadl”, shows different listings
in the two environments, however. In one of the environments, the GET
endpoint is not listed. When verified with cURL it shows the following
headers:

Server: Apache-Coyote/1.1
Allow: OPTIONS,POST
Last-modified: Mon, 16 Sep 2013 15:46:52 UTC
Content-Type: application/vnd.sun.wadl+xml
Content-Length: 820
Date: Thu, 19 Sep 2013 09:13:28 GMT

And when trying a GET operation using cURL a response with 405 (Method Not
Allowed) is returned.

So:

   - Is there any way to investigate this further on why the listing is not
   consistent in the two environments?
   - Are there any restrictions to have such was of REST endpoints in
   Jersey 1.12?

Any clue and suggestion is appreciated.

Thanks,
Behrooz