Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-18953

Unexpected JAX-RS validation error for client filters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.2.2.Final
    • 4.2.0.Final
    • webservices
    • Hide

      Place a class implementing one of the javax.ws.rs.client.ClientRequestFilter or
      javax.ws.rs.client.ClientResponseFilter in a Dynamic Web Project. Annotate the class with the javax.ws.rs.ext.Provider annotation.
      Turn on support for JAX-RS via project properties.
      Allow the project to build.
      Note the error marker produced:

      The Provider must implement at least one of the following interfaces: javax.ws.rs.ext.MessageBodyReader, javax.ws.rs.ext.MessageBodyWriter, javax.ws.rs.ext.ExceptionMapper, javax.ws.rs.ext.ReaderInterceptor, javax.ws.rs.ext.WriterInterceptor, javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter or javax.ws.rs.ext.ContextResolver.

      Show
      Place a class implementing one of the javax.ws.rs.client.ClientRequestFilter or javax.ws.rs.client.ClientResponseFilter in a Dynamic Web Project. Annotate the class with the javax.ws.rs.ext.Provider annotation. Turn on support for JAX-RS via project properties. Allow the project to build. Note the error marker produced: The Provider must implement at least one of the following interfaces: javax.ws.rs.ext.MessageBodyReader, javax.ws.rs.ext.MessageBodyWriter, javax.ws.rs.ext.ExceptionMapper, javax.ws.rs.ext.ReaderInterceptor, javax.ws.rs.ext.WriterInterceptor, javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter or javax.ws.rs.ext.ContextResolver.

    Description

      We are using JAX-RS client filters in our project. One of the classes looks like this:
      ...
      import java.io.IOException;

      import javax.ws.rs.client.ClientRequestContext;
      import javax.ws.rs.client.ClientRequestFilter;
      import javax.ws.rs.client.ClientResponseContext;
      import javax.ws.rs.client.ClientResponseFilter;
      import javax.ws.rs.ext.Provider;

      ...
      @Provider
      public class ClientFilter implements ClientRequestFilter, ClientRequestFilter
      {
      ...
      }

      The class is part of a Dynamic Web Project with JAX-RS support turned on.

      The combination of @Provider and either of the ClientRequestFilter or ClientRequestFilter appears to confuse the JAX-RS validator which produces the following error:

      The Provider must implement at least one of the following interfaces: javax.ws.rs.ext.MessageBodyReader, javax.ws.rs.ext.MessageBodyWriter, javax.ws.rs.ext.ExceptionMapper, javax.ws.rs.ext.ReaderInterceptor, javax.ws.rs.ext.WriterInterceptor, javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter or javax.ws.rs.ext.ContextResolver.

      I suspect the validator needs to be enhanced to also accept the two client filter interfaces when checking the @Provider annotation?

      Attachments

        Issue Links

          Activity

            People

              xcoulon@redhat.com Xavier Coulon
              baciuv Valentin Baciu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: