On Sep 19, 2013, at 2:46 PM, Behrooz Nobakht <nobeh5_at_gmail.com> wrote:
> Hello,
>
> We have a situation in two of our environments that are using Jersey 1.12.
>
Any reason to use such old Jersey version?
> 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.
>
Hard to guess, but my hunch is that you may have some typo in your request URI or in the resource method @Path annotation
> So:
>
> Is there any way to investigate this further on why the listing is not consistent in the two environments?
Hard to say without seeing the example. Are you SURE you have the method properly defined in your code?
> Are there any restrictions to have such was of REST endpoints in Jersey 1.12?
No restrictions I would be aware of. Still, I do not understand why you use such old Jersey version. You should consider switching to Jersey 2.3.1 or, if not possible then at least to Jersey 1.17.1.
Marek
> Any clue and suggestion is appreciated.
>
> Thanks,
> Behrooz
>