dev@grizzly.java.net

Re: servletadapter.start hides exceptions

From: gustav trede <gustav.trede_at_gmail.com>
Date: Wed, 28 Jan 2009 21:28:41 +0100

its perfectly fine that servletadapter.start throws a runtimeException
since it will wrap the real exception.

httpcontext catches the runtimeException and retrieves the real cause .

2009/1/28 Hubert Iwaniuk <neotyk_at_kungfoo.pl>

> We could check if original is ServletException, but will need for
> HttpService much tighter integration as I thought initially,
> so we might extend ServletAdapter in HttpService (need more control over
> ServletContext) and override start here.
>
>
> On Wed, Jan 28, 2009 at 9:09 PM, Jeanfrancois Arcand <
> Jeanfrancois.Arcand_at_sun.com> wrote:
>
>> Salut,
>>
>> Hubert Iwaniuk wrote:
>>
>>> 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.
>>>
>>
>> I see. The issue here is GrizzlyAdapter.start() cannoy have a reference to
>> ServletException. So either we add a new method to ServletAdapter that does
>> the same as start, but throw the exception or we redefine the start as:
>>
>> public void start() throws Exception
>>
>> eurk :-) What do you think?
>>
>> A+
>>
>> -- Jeanfrancois
>>
>>
>>>
>>> (2) Make sure the GrizzlyWebServer/GrizzlyAdapterChain catch those
>>> exception and logs them and still be able to start other Adapter
>>> added.
>>>
>>> Thanks
>>>
>>> -- Jeanfrancois
>>>
>>>
>>>
>>>
>>> Either throwing the Throwable or returning a boolean status flag
>>> should work.
>>>
>>> whats your opinion ?
>>>
>>> -- regards
>>> gustav trede
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
>>> <mailto:dev-unsubscribe_at_grizzly.dev.java.net>
>>> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>>> <mailto:dev-help_at_grizzly.dev.java.net>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>>
>>
>
>
> --
> Hubert Iwaniuk
>



-- 
regards
 gustav trede