dev@grizzly.java.net

Re: servletadapter.start hides exceptions

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Wed, 28 Jan 2009 15:19:29 -0500

Salut,

gustav trede wrote:
>
>
> 2009/1/28 Hubert Iwaniuk <neotyk_at_kungfoo.pl>
>
> Hi,
> Comment inline
>
> On Wed, Jan 28, 2009 at 8:43 PM, Jeanfrancois Arcand
> <Jeanfrancois.Arcand_at_sun.com <mailto:Jeanfrancois.Arcand_at_sun.com>>
> wrote:
>
> Salut,
>
>
> gustav trede wrote:
>
> hell,
>
> servletadapter.start() hides exceptions.
>
> If the servlet.init or so fails ,
> httpservice.registerServlet should be able to detect it and
> abort the servlet registration ,
> leaving the alias free to use instead of locked by an
> invalid servlet ?
>
>
> I agree we need to fix that. I would change two things:
>
> (1) Throw a RuntmeException instead of just logging the exception.
>
>
> HttpService when registering needs to throw ServletException if
> provided Servlet.init() throws it.
>
>
> yes. so catch runtimeException and rethrow a new servletexception.

+1 I think this is the solution. Catch the RuntimeException, get the
original exception from it (ServletException) and re-throw it.

A+

-- Jeanfrancois


>
>
> --
> regards
> gustav trede
>
>