4 Replies Latest reply on Nov 8, 2015 12:46 AM by Arun Gupta

    HTTP 405 for JAX-RS DELETE on WildFly

    Arun Gupta Newbie

      Hi there ...

       

      Building a simple application that shows Java EE CRUD with Couchbase.

      Of course, my choice of application server is WildFly!

       

      The resource has all GET, PUT, POST, DELETE methods as shown at:

       

      https://github.com/arun-gupta/couchbase-javaee/blob/master/src/main/java/org/couchbase/sample/javaee/AirlineResource.java

       

      However invoking DELETE method as:

       

      * Connected to localhost (127.0.0.1) port 8080 (#0)

      > DELETE /couchbase-javaee/resources/airline/19811 HTTP/1.1

      > User-Agent: curl/7.37.1

      > Host: localhost:8080

      > Accept: */*

       

      gives the following results:

       

      < HTTP/1.1 405 Method Not Allowed

      < Allow: HEAD, GET, OPTIONS, PUT

      < Connection: keep-alive

      < X-Powered-By: Undertow/1

      * Server WildFly/9 is not blacklisted

      < Server: WildFly/9

      < Content-Length: 0

      < Date: Sat, 07 Nov 2015 10:37:03 GMT

       

      GET on the same resource succeeds:

       

      * Connected to localhost (127.0.0.1) port 8080 (#0)

      > GET /couchbase-javaee/resources/airline/19811 HTTP/1.1

      > User-Agent: curl/7.37.1

      > Host: localhost:8080

      > Accept: */*

      >

      < HTTP/1.1 200 OK

      < Connection: keep-alive

      < X-Powered-By: Undertow/1

      * Server WildFly/9 is not blacklisted

      < Server: WildFly/9

      < Content-Type: application/octet-stream

      < Content-Length: 136

      < Date: Sat, 07 Nov 2015 11:00:37 GMT

       

      Any idea why POST is not shown in the list of allowed methods?

       

      And particularly why 405 is returned on DELETE?

       

      Arun