users@jersey.java.net

custom exception output

From: Tim Clotworthy <tclotworthy_at_integratedsecure.com>
Date: Thu, 5 Nov 2009 07:57:12 -0500

Hello, I have a requirement from my customer that errors be returned from resources in a response with the following format:


<?xml version="1.0" ?>

<ExceptionReport

version="1.1.0"

xmlns="http://www.opengis.net/ogc"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="owsExceptionReport.xsd">

<Exception code="999" locator="INSERT STMT 01">

<ExceptionText>parse error: missing closing tag for element wkbGeom</ExceptionText>

</Exception>

</ExceptionReport>



My question is, can this structure be accomplished by throwing WebApplicationException from the resource class, or will it require using ExceptionMapping Providers (or do you need more information)?



At the source, both checked and unchecked exceptions can be thrown and ultimately propagated up to the root resource (if that has any bearing). Thanks for any response.