Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2495

ContainerXFilter not invoked when registered via DynamicFeature in JAX-RS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 8.0.0.Beta1, 8.1.0.Final
    • REST
    • None

      @Provider
      public class DynamicServerLogggingFilterFeature implements DynamicFeature {
      
          @Override
          public void configure(ResourceInfo ri, FeatureContext fc) {
              if (MyResource.class.isAssignableFrom(ri.getResourceClass())
                      && ri.getResourceMethod().isAnnotationPresent(GET.class)) {
                  fc.register(new ServerLoggingFilter());
              }
          }
      }
      
      @Provider
      @ServerLogged
      public class ServerLoggingFilter implements ContainerRequestFilter, ContainerResponseFilter {
      ...
      }
      

      DynamicServerLogggingFilterFeature is called the the ServerLoggingFilter is registered in the FeatureContext, but the filter(ContainerXContext crc) is never called on the ServerLoggingFilter.

      Sample: https://github.com/arun-gupta/javaee7-samples/tree/master/jaxrs/dynamicfilter

            rsigal@redhat.com Ronald Sigal
            aslak@redhat.com Aslak Knutsen
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: