tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: classreloading and 4.x
Date Wed, 03 Jan 2001 02:22:00 GMT
Jon Stevens wrote:

> Ok, I have this in my server.xml:
>         <Context path="" docBase="scarab" reloadable="true"/>
> Yet when I change a class in my WEB-INF/classes directory, it doesn't get
> reloaded. Any ideas?

I just tried this again (against current CVS code) with Vincent's original test
cases and it works fine for me.  I can send you the test suite if you like, to
verify that it works/doesn't work in your environment.

One issue that might cause this appearance is if you don't wait long enough.  By
default, Tomcat 4.0 checks for classfile changes every 15 seconds, if reloadable
is set to true.  You can change this as follows:

    <Context path="" docBase="scarab" reloadable="true">
        <Loader checkInterval="5"/>

As an alternative (and this works even on apps that you have not defined as
"reloadable" in server.xml), consider this strategy:

* Install the "manager" webapp that comes with Tomcat if not
  present already.

* Create a user with role "manager" in server/tomcat-users.xml
  (actual username and password are arbitrary).

* Whenever you want to restart Scarab, issue an HTTP request to:
  where /xxx is the context path (empty string for the root webapp).

* You will need to log on (BASIC authentication) the first time you
  do this, with the username/password you created above.

NOTE:  In reviewing the code, it looks like this won't handle the root webapp
correctly until I do a quick bugfix, but the basic principle applies.

> -jon


View raw message