ExceptionMapper not work in grizzly
Sorry for my poor English. I'm using grizzly and jersey to build a web application. And I implement like this ErrorModel errorModel = new ErrorModel("1", "1", "1"); WebApplicationException applicationException = (WebApplicationException) exception; return Response.status(applicationException.getResponse().getStatus()).type(MediaType.APPLICATION_JSON_TYPE).entity(errorModel).build(); When I visited a page which does not exist. I found that it throw a WebApplicationException. So I debug and found this method is being called and return the response above. But finally the http response is a html