Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-1414

Undertow suppresses JAX-RS error message

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0.0.Alpha2
    • 8.0.0.Alpha2
    • REST, Web (Undertow)
    • None

    Description

      I'm using a snapshot of WildFly 8.0.0.Alpha2 containing Undertow 1.0.0.Alpha17.

      My RESTful Web Service in a war is using an ExceptionMapper (see below) which converts an exception into a 404 error code and also an error message. Now I try to submit a GET request resulting in an exception to be mapped.
      I get the 404 error code, but NOT the error message. Instead I'm getting the contents of the error page which is declared in web.xml for a 404 error. In EAP 6.1.Beta I'm getting the error message produced by the exception mapper.

      The exception mapper class:
      @Provider
      @ApplicationScoped
      public class NotFoundExceptionMapper implements ExceptionMapper<NotFoundException> {
      @Override
      public Response toResponse(NotFoundException e)

      { final String msg = e.getMessage(); final Response response = Response.status(NOT_FOUND) .type(TEXT_PLAIN) .entity(msg) .build(); return response; }

      }

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            juergen.zimmermann Juergen Zimmermann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: