Results 1 to 2 of 2
  1. #1
    remya11 is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Resteasy in-built exceptions not caught in the exception mapper

    Hi friends,

    I have written some exception mappers to catch and handle the in-built rest easy exceptions like NotFoundException,MethodNotAllowedException, etc., Sample code as shown:

    @Provider
    public class NotFoundExceptionMapper implements ExceptionMapper<org.jboss.resteasy.spi.NotFoundExc eption>
    {
    @Override
    Response toResponse(org.jboss.resteasy.spi.NotFoundExceptio n exception) {
    return Response.status(500).build();
    }
    }

    I have also written a try catch block in my web filter class. Whenever a NotFoundException occurs, it is not caught in the mapper, but it goes to the catch block in the Filter.

    Whereas I have tried another exception mapper class to handle JsonParsingException. This is working correctly and giving a proper response from the mapper whenever a Json Parse exception occurs.

    The issue is only with the case of resteasy inbuilt exceptions.
    Also, the Provider has been registered in the application context using the include-filter tag inside component scan.
    Is there any additional configuration to be done for this?

    Please guide me as to what needs to be done to catch rest easy in-built exceptions in the mapper class itself.

    Regards,
    RM

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: Resteasy in-built exceptions not caught in the exception mapper

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Exception not caught
    By ankiit in forum New To Java
    Replies: 2
    Last Post: 03-21-2012, 08:16 AM
  2. Replies: 7
    Last Post: 03-21-2012, 08:07 AM
  3. SQLException caught: Communications link failure due to underlying exception: **
    By sharanya in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-25-2011, 09:46 AM
  4. Replies: 5
    Last Post: 02-14-2011, 11:39 PM
  5. Replies: 2
    Last Post: 10-08-2010, 12:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •