2

I am trying to run a rest api with a http patch method on a wildfly 10.1.0.Final. If I made a request on this endpoint i get a 405 Method Not Allowed.

I use javax.javaee-api:8.0.

Patch:

@PATCH
@Path("/documents/{id}")
public Response patchDocument(@PathParam("id") String id,
        @ApiParam(value = "", required = true) @Valid PatchRequestSTO jsonPatch) {
    return ok(jsonPatch.toString()).build();
}

Response: 405 Method Not Allowed

Allow:OPTIONS, PUT
Connection:keep-alive
Content-Length:0
Date:Fri, 05 Jan 2018 07:55:44 GMT
Server:WildFly/10
X-Powered-By:Undertow/1

Put:

@PUT
@Path("/documents/{id}")
public Response putDocument(@PathParam("id") String id,
        @ApiParam(value = "", required = true) @Valid PatchRequestSTO jsonPatch) {
    return ok(jsonPatch.toString()).build();
}

Response: 200 Ok

mutzel
  • 23
  • 4

1 Answers1

1

Are you using javax.javaee-api:8.0 as dependency in your project? That is not enough to run a Java EE 8 application on WildFly 10.1.0.Final, because wildfly does not support it.

So you need an application server (Glassfish, Open Liberty, ...) that is supporting JavaEE 8 to use the new features.

Georg Leber
  • 3,470
  • 5
  • 40
  • 63
  • thanks, you are right -> http://wildfly-development.1055759.n5.nabble.com/WildFly-12-Plans-EE8-and-Move-to-Quarterly-Iterative-Releases-td5718321.html – mutzel Jan 05 '18 at 10:34