My exception mapper looks like below
@Provider
public class DAExceptionMapper implements ExceptionMapper<DAException> {
@Override
public @ResponseBody Response toResponse(DAException exception) {
}
}
public class DAException extends Exception {
}
I'm using Spring 3.2.5 with Jersey 2.15 on Jetty 8.1.14.
I'm can't find why my exception mapper is not getting registered with Spring. I get 500 when I throw a custom DAException in my application. I tried all solutions in https://java.net/jira/browse/JERSEY-2063. None of them worked.
I currently don't have any beans for exception registered in spring context xml. My application doesn't set resources through program.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is DAException [responseStatus=Unauthorized, errorMessage=ErrorMessage [errorMessage=User is not allowed to access this resource.], errorDescription=User is not allowed to access this resource.]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)