On Tue, 27 Mar 2001, Kevin Jones wrote:

> Tomcat 4.0 stops configuring listeners if one of the listeners in the list
> isn't present, should it carry on configuring the rest of the listeners it
> finds? The spec is silent on this and it seems odd that if somebody (maybe
> accidentally) deletes a listener class all other following listeners are not
> configured (any listener preceding the missing listener would already have
> been initialised).
> 

Here's the rationale for this behavior (and the fact that Tomcat also
marks the app unavailable if it didn't initialize all the listeners and
filters successfully):

Let's say you are implementing user authentication yourself, and using
filters.  You specify connection information to a database in your filter
params, but mistype the password so that the connection cannot be
established, so your filter's init() method throws an exception.  If
Tomcat just logged this as a warning and went on deploying your app, it
would now be running with *no* authentication, potentially exposing
sensitive information.  Is that what you *really* want to have happen?

One might argue missing listeners would be less severe a risk than missing
filters, but IMHO that isn't the container's judgement to make -- the user
has an incomplete application deployed; better to make them go fix it
rather than trying to run only part of it.

> I've also raised this as a bug,
> 
> Thanks,
> 
> Kevin
> 
> 

Craig


Reply via email to