Why are error pages ignored in RESTEasy web service running on Tomcat?
Posted
by Chandru
on Stack Overflow
See other posts from Stack Overflow
or by Chandru
Published on 2010-03-04T07:18:14Z
Indexed on
2010/03/31
23:13 UTC
Read the original article
Hit count: 411
I'm developing a REST-ful web service using RESTEasy deployed on Tomcat. I've configured an error page which takes the exception's message and generates an XML based on it when any exception occurs during the request.
This works fine for any application generated exceptions. However, if client sends an invalid XML which cannot be unmarshalled correctly, an javax.xml.bind.UnmarshalException
is thrown and Tomcat's default error page is used instead of mine.
I have configured my error page to the error-code 500 in web.xml.
Is using error pages the correct way to handle errors when using RESTEasy or is there an alternative way?
© Stack Overflow or respective owner