users@jersey.java.net

Custom Errors and Glassfish

From: <ben.mail_at_vtxfree.ch>
Date: Wed, 16 Jan 2008 19:56:26 -0500

Related to :
https://jersey.dev.java.net/servlets/ReadMsg?list=users&msgNo=390

I am trying to map a error class / code to custom error page in my web.xml.
I am executing following method:

    @HttpMethod("POST")
    @ConsumeMime({"application/xml", "application/json"})
    public Response post( Foo data) {

- Errors from the container like marshalling or basic auth exception do get
mapped
- Throwing programmatically a RuntimeException gets mapped

- however when throwing: new
WebApplicationException(Response.Builder.serverError().status(403).build());
I get the standard glassfish error page (with the correct error) and the
mapping to my custom error page fails. Nothing in the server log indicating
a mapping error.
I am using nb6, jersey 0.4, glassfishv2ur1.

.
Side question, sorry if this is documented elsewhere: do you recommend using
jersey 0.5-ea instead of the latest 0.4 / differences?

Thanks Ben