You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by tamir <ta...@movious.com> on 2002/02/14 09:54:15 UTC

reloading classes - rephrase

Hi there,
I've a simple question, hope there's a simple answer.

Is it possible to do autoreload for classes not found in WEB-INF/classes or
WEB-INF/lib
without restarting tomcat or reloading my web-app classes ?
(I mean i put my classes OUTSIDE the web-app).

I'm using tomcat 3.3, but can do the advance to 4.02 if needed.

Tnx Alot
for any information!!!!!


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: reloading classes - rephrase

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

On Thu, 14 Feb 2002, tamir wrote:

> Date: Thu, 14 Feb 2002 10:54:15 +0200
> From: tamir <ta...@movious.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: reloading classes - rephrase
>
> Hi there,
> I've a simple question, hope there's a simple answer.
>
> Is it possible to do autoreload for classes not found in WEB-INF/classes or
> WEB-INF/lib
> without restarting tomcat or reloading my web-app classes ?
> (I mean i put my classes OUTSIDE the web-app).
>
> I'm using tomcat 3.3, but can do the advance to 4.02 if needed.
>
> Tnx Alot
> for any information!!!!!
>

The answer is simple:  no.

Java provides no mechanism for unloading a class that has already been
loaded.  The way that reloading is implemented for a webapp is to throw
away the entire class loader used to load that webapp, and starting over
again.  If we did that for shared classes, however, you'd have to restart
*all* webapps because they would all need to be thrown away.

If you want to take advantage of the auto-reload capability to update
classes in a webapp, you *must* put those classes in /WEB-INF/classes, or
in a JAR file in /WEB-INF/lib.

Craig McClanahan



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>