users@jersey.java.net

ExceptionMapping - 500 or still no message

From: Daniel Manzke <daniel.manzke_at_googlemail.com>
Date: Wed, 14 Apr 2010 15:38:15 +0200

Hi,

I developed a Service with the help of JAX-RS and I'm fighting a little bit
with the Exception handling. I searched through the Mail-List and saw that
there was some similiar problem and it was fixed. Maybe I'm just doing
something wrong. ;)


I saw that when I'm using the WebApplicationException and just passing a
Status, I'll get the error page with the right code, but it's not possible
to write something in the message field.
So I created a Exception which inherits from WebApplicationException and
wraps up my thrown Exceptions. The Stacktrace will be displayed, but not the
Error-Page.

So I did the next try with the ExceptionMapper. This will end in an
Error-Page with 500 and the "root causes" message, but the passed StatusCode
is ignored.



What I want to do?
- throw a Exception with a Status Code
- display the Error-Page with the right Status Code and the Stacktrace


Any idea?


Thanks,
Daniel :)