users@jersey.java.net

Re: [Jersey] Error message with ExceptionMapper not visible (Tomcat)

From: Casper Bang <casper.bang_at_gmail.com>
Date: Mon, 14 Dec 2009 21:21:56 +0100

> You mean the entity, ex.getMessage(), is not received by the client?
Yeah, Tomcat 6.0.18 just gives me:

HTTP Status 400 -
type Status report
message
description The request sent by the client was syntactically incorrect()

The same is the case btw. if I directly return a 400:

    @GET
    public Response root(){
        return Response.status(400)
                .entity("Bla bla")
                .type("text/plain")
                .build();
    }


So I think all is fine with the provider/mapping aspect, but for some
reason Tomcat overrides with its own 400 handler. I'm using Jersey as a
filter rather than a servlet. Could that have soemthing to say? Not sure
how to enable Jersey response logging (apart from using a LoggingFilter,
which doesn't really reveal much).

Regards,
Casper