Hi all,
this may be a general Java question or their may be a specific answer related to Tomcat.

I am running a simple webservice which loads classes using a URLClassloader...

// start of code snippet
ClassLoader previous = Thread.currentThread()
                                        .getContextClassLoader();
URLClassLoader loader = new URLClassLoader(new URL[]
                         { new URL("http://localhost/classes/";)}, previous);


String className = "common.MyClassToBeLoaded";
                        Class<?> ho = loader.loadClass(className);
// end

This ok, but when I edit and recompile a class which is loaded, the changes to MyClassToBeLoaded.java are not reflected in the webservice.

I suspect that the class is being cached and won't be cleared until the JVM restarts (i.e. the Tomcat server will have to be restarted).


My Question:
Is there a way to empty this cache, or disable caching all together?

There are some suggestions out there but none specific to Tomcat.

Effectively, I need to clear the cache, all the better if my code can do it each time I load the MyClassToBeLoaded.class.


Peter


--
with best regards,
Peter Lavin,
PhD Candidate,
Computer Architecture & Grid Research Group,
Lloyd Institute, 005,
Trinity College Dublin, Ireland.
+353 1 8961536

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to