Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3248

CXF JAX-RS assumes custom Application returns providers only via Application.getSingletons

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.2
    • 2.3.2, 2.4
    • JAX-RS
    • None

    Description

      Example 7-1 of the JAX-RS book samples (see https://issues.apache.org/jira/browse/CXF-3247) is returning a unclear error message when it processes the following ExceptionMapper:

      @Provider
      public class NotFoundExceptionMapper implements ExceptionMapper<NotFoundException>
      {
      public Response toResponse(NotFoundException exception)

      { return Response.status(Response.Status.NOT_FOUND) .entity(exception.getMessage()) .type("text/plain").build(); }

      }

      This is the error message it's returning:
      WARNING: No resource methods have been found for resource class com.restfully.shop.services.NotFoundExceptionMapper

      I'm not sure why an exception mapper needs to have resource methods, or what a "resource method" is for that matter. I think this error is appropriate for root resources only and not exception mappers, if so, this message should be suppressed for exception mappers. OTOH, if this warning does have meaning for exception mappers, could it be made clearer for newbies/novices?

      Note this example has other bugs with it, not related to this problem (https://issues.jboss.org/browse/RESTEASY-495).

      To duplicate, download and extract RESTEasy and make the pom.xml and web.xml changes all described in https://issues.apache.org/jira/browse/CXF-3247. Then just run mvn clean install and you'll see the above error message.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            gmazza Glen Mazza
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: