Eclipse + Tomcat plugin: problem with automatic class reloading  
Author Message
gcoghlan





PostPosted: 2003-12-23 19:45:00 Top

java-programmer, Eclipse + Tomcat plugin: problem with automatic class reloading Hi all,
I am having a problem using the DevLoader that comes with the eclipse
plugin for Tomcat from sysdeo.
It is loading classes okay from locations.
But it is not reloading them when they change.
The reloading works okay for a class that is WEB-INF/classes.

Here are the details:
Versions:
eclipse version 2.1.1
eclipse Tomcat plugin V 2.2.1
Tomcat version 4.1.29
JDK 1.3.1_04

I have extracted the DevLoader zip into [Tomcat Home]/server/classes
directory.
The tomcat server is using this DevLoader to load the classes.
I set the debug level in my web-app Context in conf/server.xml for the
loader to 4.
(<Loader className="org.apache.catalina.loader.DevLoader"
reloadable="true" debug="4"/> )
Logging is redirected to the console.

I can see output in the console that shows that it added my classes
location:
[DevLoader] added file:/C:/dev/workspace/Test/classes/

This is the location to find a class ims.test.TestServlet.
And it is able to find this class:

WebappClassLoader: loadClass(ims.test.TestServlet, false)
WebappClassLoader: Searching local repositories
WebappClassLoader: findClass(ims.test.TestServlet)
WebappClassLoader: findClassInternal(ims.test.TestServlet)
WebappClassLoader: loadClass(javax.servlet.http.HttpServlet, false)
WebappClassLoader: Delegating to parent classloader
WebappClassLoader: Loading class from parent
WebappClassLoader: Returning class class ims.test.TestServlet
WebappClassLoader: Loaded by WebappClassLoader
available:
delegate: false
repositories:
/WEB-INF/classes/
required:

I find it strange that my location
(file:/C:/dev/workspace/Test/classes/) is under the repositories.

If change the code (recompile) ims.test.TestServlet it is NOT
reloaded.
However, if I have a class that is to be found in WEB-INF/classes
e.g. I have a different class ims.TestServlet that is in
WEB-INF/classes/

WebappClassLoader: loadClass(ims.TestServlet, false)
WebappClassLoader: Searching local repositories
WebappClassLoader: findClass(ims.TestServlet)
WebappClassLoader: findClassInternal(ims.TestServlet)
WebappClassLoader: Returning class class ims.TestServlet
WebappClassLoader: Loaded by WebappClassLoader
available:
delegate: false
repositories:
/WEB-INF/classes/
required:

Then if I change ims.TestServlet it IS reloaded.

WebappClassLoader: Resource '/WEB-INF/classes/ims/TestServlet.class'
was modified; Date is now: Tue Dec 23 10:33:32 GMT 2003 Was: Tue Dec
23 09:28:57 GMT 2003

thank you for any help you can give,
and best wishes for Christmas + the New Year,
Grainne Coghlan