You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by tek1 <te...@pobox.com> on 2002/06/06 07:56:55 UTC

no notification when incorrect classes are specified in web.xml

does anyone know which catalina class is responsible for loading the 
servlet and filter classes specified in the web.xml file?

i've noticed that when i start tomcat that tomcat gives no notification 
when the classes, specified in web.xml (i.e. <filter-class> or 
<servlet-class>), are not valid.

if possible, i would like to fix this problem, i feel that it would be 
better if the class loader printed out a message when tomcat starts that 
the specified servlet/filter could not be found.

thank you.



environment info
--------------
tomcat version:	4.0.4b3
os:			windows2000
java version:	jdk1.3.1_03 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: no notification when incorrect classes are specified in web.xml

Posted by Phillip Morelock <su...@phillipmorelock.com>.
Servlets etc are not loaded until needed.  This is specified behavior, IIRC.
Maybe not, but for some reason I seem to recall that there's a reason behind
this.  Maybe it's just the simple resource usage argument.

To work around it (for example, during development), add a load-on-startup
tag to each.

fillup



On 6/5/02 10:56 PM, "tek1" <te...@pobox.com> wrote:

> does anyone know which catalina class is responsible for loading the
> servlet and filter classes specified in the web.xml file?
> 
> i've noticed that when i start tomcat that tomcat gives no notification
> when the classes, specified in web.xml (i.e. <filter-class> or
> <servlet-class>), are not valid.
> 
> if possible, i would like to fix this problem, i feel that it would be
> better if the class loader printed out a message when tomcat starts that
> the specified servlet/filter could not be found.
> 
> thank you.
> 
> 
> 
> environment info
> --------------
> tomcat version:    4.0.4b3
> os:            windows2000
> java version:    jdk1.3.1_03
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: no notification when incorrect classes are specified in web.xml

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 6 Jun 2002, tek1 wrote:

> Date: Thu, 06 Jun 2002 01:56:55 -0400
> From: tek1 <te...@pobox.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: no notification when incorrect classes are specified in web.xml
>
> does anyone know which catalina class is responsible for loading the
> servlet and filter classes specified in the web.xml file?
>

The loading class depends on which application class you're talking about:
* Servlets - org.apache.catalina.core.StandardWrapper
* Filters - org.apache.catalina.core.ApplicationFilterConfig
* Listeners - org.apache.catalina.core.StandardContext

> i've noticed that when i start tomcat that tomcat gives no notification
> when the classes, specified in web.xml (i.e. <filter-class> or
> <servlet-class>), are not valid.
>
> if possible, i would like to fix this problem, i feel that it would be
> better if the class loader printed out a message when tomcat starts that
> the specified servlet/filter could not be found.
>

To do these checks at startup time, you'd probably want to add the
additional logic to the start() method in
org.apache.catalina.core.StandardContext - this is called as an
application is being started up, and would be the right time to log the
messages you are talking about.  From here you also have access to all of
the configuration information you need, via the
findApplicationListeners(), findFilterDefs(), and findChildren() methods.
The latter one gives you a Wrapper for each servlet definition.

If you come up with a patch that adds this functionality, could you please
post it as an attachment to an "Enhancement Request" in the bug tracking
system?  That way, a Tomcat committer can evaluate and apply it.

  http://nagoya.apache.org/bugzilla/

Craig McClanahan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>