users@jersey.java.net

[Jersey] Re: How to stop initialization of JAX-RS application?

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Mon, 17 Jan 2011 12:03:16 +0100

On Jan 14, 2011, at 3:57 PM, Markus Karg wrote:

> Dear Jersey Community,
>
> I wonder what is the correct way to make Jersey stop initializing an
> application?
>
> My Application might run into an exception inside of
> getSingletons(), e. g. when trying to set up a JAXBContext. How to
> forward this to Jersey? It makes no sense to boot up without that
> context, but getSingletons() has no throws clause in its signature.
>
> ???
>

If you throw a runtime exception it will get passed to the servlet
layer, which will then result in a deployment failure.

Paul.