My issue is quite simple, I hava a generic parent class with the following JAXRS definition
@POST
@Restricted(permissions = {"*_create"})
public Response save(T entity) throws Exception {
And I created a specific child class with generic parameter T becoming Access type, which have the following declaration:
@POST
@Restricted(permissions = {"*_create"})
@Consumes({"application/x-www-form-urlencoded", "application/json", "application/xml"})
public Response save(final Access newAccess, @HeaderParam("Authorization") String token, @Context HttpServletRequest request) throws Exception {
My issue is that Resteasy has apparently a random behavior that is set on war launch that it will keep for application lifetime. Some time it associates the incomming POST request to the parent save method, sometime to the child one. I aim to get the child one being systematically used, but I want to avoid to change my parent class as lot’s of resource defining classes in my project rely on it with no issue (and do not override the save method for instance). Is there an easy (like in resteasy) way to fiw this issue ?
As for now the solution I found was to override the parent method signature
public Response save(T entity) throws Exceptionin the child class, without any annotation but the@Override. The method definition contains athrow new UnsupportedOperationException();.This make the other save declaration with jaxrs annotation in this child class to be chosen without ambiguity.