cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Mazza (JIRA)" <>
Subject [jira] Commented: (CXF-3248) JAX-RS (wrongly?) complaining about no resource methods for ExceptionMappers.
Date Sun, 16 Jan 2011 18:44:43 GMT


Glen Mazza commented on CXF-3248:

Instructions for running the example are in the last sentence of the description.  NotFoundExceptionMapper
is as given in the description, and linked in as follows:

public class ShoppingApplication extends Application
   private Set<Object> singletons = new HashSet<Object>();
   private Set<Class<?>> classes = new HashSet<Class<?>>();

   public ShoppingApplication()
      singletons.add(new CustomerResource());


> JAX-RS (wrongly?) complaining about no resource methods for ExceptionMappers.
> -----------------------------------------------------------------------------
>                 Key: CXF-3248
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Glen Mazza
>            Priority: Minor
> Example 7-1 of the JAX-RS book samples (see
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
> 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 (
> To duplicate, download and extract RESTEasy and make the pom.xml and web.xml changes
all described in  Then just run mvn clean
install and you'll see the above error message.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message