If you go this way... remember the following
ClassLoader cl1 = new URLClassLoader(urls);
Class cls1 = cl1.loadClass("classPath");
ClassLoader cl2 = new URLClassLoader(urls);
Class cls2 = cl2.loadClass("classPath");
cls1 == cls2 <=== FALSE not TRUE as you might expect
Johnny Kewl wrote:
>
> This is the kind of thing tomcat cant really do for you.... and it
> depends very much on the sophistication needed.
> One dirty trick, is to change the web.xml file slightly, when TC gets a
> little quiet time it will reload the whole web app, ie when its able to
> shed all classes.... dont really recommend it, but I have used it in the
> past.
>
> More sophisticated method is to read up on
> ClassLoader cl = new URLClassLoader(urls);
> Class cls = cl.loadClass("classPath");
> ie your program determines when it needs the new class, could do this by
> checking the last modified time of the file attribute....
>
> have fun
>
>
>
> ----- Original Message ----- From: "santa T" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, July 10, 2007 2:18 AM
> Subject: How to replace jar which was already loaded?
>
>
>> Hi
>> I have a "worker.jar" in my webapp. User could upload a new "worker.jar"
>> replacing it. And I don't want to restart the tomcat.
>> How can I implement this?
>>
>> Thanks.
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: [email protected]
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]