On Tue, 17 Apr 2001 [EMAIL PROTECTED] wrote:

> Servlet reloading works fine under Tomcat, however I've been bitten
> where the servlet re-loaded OK, but a class my servlet depends on
> changed but was not reloaded.
>
> For example, if ServletA uses StaticServiceB.  I can reload ServletA
> all day long, but changes to StaticServiceB wont be picked up until
> a restart.  I don't know if this is applicable for your situation or
> not, but it's gotten me before so I thought I'd mention it.

This probably has to do with where the class in question is, and hence
which classloader is used to load it.  Classes that are on the
classpath are loaded by the system classloader, and are not subject to
reloading.  Classes that are in the webapp's/context's classes
subdirectory (and the lib subdirectory, I believe) are loaded by a
special tomcat classloader, and are subject to reloading.

Does that fit with what you were experiencing?

Of course, other things may be a factor in where you place classes
(like where they most logically belong), but while you're developing,
you might want to put such classes in the classes subdirectory, and
then when you're moving to production, move them to the "better"
place.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

Reply via email to