I\'m trying to use a ContainerRequestFilter
to enforce some authentication on a Tomcat based Jersey application. I followed this document.
Problem : the filter
We were missing the below call in our ResourceConfig implementation class:
register(CorrelationIdFilter.class);
I had the same problem for JAX-RS 2 , jersey and the below annotation fixed it
@PreMatching
I also had to add the @Provider JAX-RS annotation to my filters.
This makes the filter discoverable during JAX-RS scanning phase.
@Provider
public class MyAppFilter implements ContainerRequestFilter {
// filter logic
}
For anybody having this problem in MULE ESB. Remember to register path with:
<jersey:resources doc:name="REST">
<component doc:name="rest component">
<spring-object bean="endpoit"/>
</component>
<jersey:package packageName="path @Provider-s"/>
</jersey:resources >