title: Jersey Resource Filter not forwarding request
body: <p>I am working on a Jersey implementation wherein my requirement is to verify and validate the request body and forward it to the REST resource.</p>
  
  <p>The validation and verification are working fine inside registered filter but for forwarding. The request is not getting forwarded to the REST resource. I am unable to figure what is that I am missing. Here is my configuration and code</p>
  
  <p>web.xml </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;init-param&gt;
      &lt;param-name&gt;com.sun.jersey.spi.container.ResourceFilters&lt;/param-name&gt;
      &lt;param-value&gt;com.level3.messaging.producer.auth.PubRequestFilterFactory&lt;/param-value&gt;
  &lt;/init-param&gt;
  </code></pre>
  
  <p>My Resource filter factory</p>
  
  <pre class="lang-java prettyprint-override"><code>@Component
  @Provider
  public class PubRequestFilterFactory implements
      ResourceFilterFactory {
  
      @Autowired
      PublisherRequestFilter publisherRequestFilter;
  
      @Override
      public List&lt;ResourceFilter&gt; create(AbstractMethod am) {
      return Collections
          .&lt;ResourceFilter&gt; singletonList(publisherRequestFilter);
      }
  
  }
  </code></pre>
  
  <p>My Resource Filter implementation</p>
  
  <pre class="lang-java prettyprint-override"><code>@Component
  @Provider
  public class PublisherRequestFilter implements ResourceFilter {      
  
      @Override
      public ContainerRequestFilter getRequestFilter() {
  
      return new ContainerRequestFilter() {
          /**
           * Checks if the incoming request is appropriate for the request
           * body. If not throws a web application exception
           */
          @Override
          public ContainerRequest filter(ContainerRequest request) {
           // returned request is not gettting forwared.
                              // I was able to debug thru request
          return request;
          }
      };
      }
  
      @Override
      public ContainerResponseFilter getResponseFilter() {
      return null;
      }
  
  }
  </code></pre>
  
  <p>My REST Resource Implementation</p>
  
  <pre class="lang-java prettyprint-override"><code>@Component
  @Produces("application/xml")
  @Path("publish")
  @Scope("singleton")
  public class Publisher extends MessageResource {     
  
      @POST
      @Path("event")
      @Consumes("application/xml")
      @Produces("application/xml")
      public ProducerResourceResponseWrapper publishEvent(Event event) {
          super.message = event;
          final Long startTime = System.currentTimeMillis();
          init(MessagePattern.Event.name());
          publishMessage(startTime);
          return responseWrapper;
      }
  
  
      private void publishMessage(Long startTime) {
      String errorMessage = null;
      try {
          final MessageDelegator eventDelegator = new MessageDelegator(
              publisherResourcesDO);
          eventDelegator.delegate();
          if (publisherResourcesDO.getErrorDO() != null) {
          throw new ErrorHandler(publisherResourcesDO.getErrorDO());
          }
          buildResponse(startTime);
      } catch (final Exception e) {
          errorMessage = e.getMessage();
          handleException(e);
      } finally {
          auditMessage(startTime, errorMessage);
      }
  
      } 
  }
  </code></pre>