I am trying to do some validation on requests coming into my service using the ContainerRequestFilter. Everything is working fine, however there is one problem
@PreMatching does not work together with @NameBinding, because the resource class/method is not yet known in pre-matching phase.
I solved this issue by removing @PreMatching from the filter and using binding priority. See ResourceConfig.register(Object component, int bindingPriority).
Filters to be executed before the resource simply get a higher priority.