You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by SANGAMESHWAR ALLADI <sa...@gmail.com> on 2007/03/15 13:02:07 UTC

how to configure the tomcat to automatically update class instances when a class file changed

hi,
my class files of beans regularly changes.
So,everytime i change a class file, i need to restart the tomcat server.
how can i configure Tomcat to watch the changes in the class files of beans?

Thanks in Advance,
Sangmaeshwar.A

RE: how to configure the tomcat to automatically update class instances when a class file changed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: org@kewlstuff.co.za [mailto:org@kewlstuff.co.za] 
> Subject: Re: how to configure the tomcat to automatically 
> update class instances when a class file changed
> 
> The autoDeploy="true" means the sevlet will reload if 
> anything is changed under WEB-INF

That's not quite true.  The autoDeploy attribute allows deployment of
applications on the fly, but only monitors the following for existing
applications:

    * An update to the WEB-INF/web.xml file will trigger a reload of the
web application
    * An update to a WAR which has been expanded will trigger an
undeploy (with a removal of the expanded webapp), followed by a
deployment
    * An update to a XML configuration file will trigger an undeploy
(without the removal of any expanded directory), followed by a
deployment of the associated web application

If you're changing jars or class files under WEB-INF, you need a
<WatchedResource> element inside the <Context> for the webapp.  By
default, only WEB-INF/web.xml is monitored.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: how to configure the tomcat to automatically update class instances when a class file changed

Posted by or...@kewlstuff.co.za.
Hello again SANGAMESHWAR
In the servlet.xml config file you will see the
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"

The autoDeploy="true" means the sevlet will reload if anything is changed 
under WEB-INF
So if you  drop another library class in, or say change web.xml, that 
servlet will restart WHEN IT IS IDLE.
If you have a thread running in a background process, then I dont think it 
will ever restart.

Its clever but it does mean Tomcat has to rev up all over again and on a 
busy server thats probably not a good thing.

Other alternative is to make a plugin, and load up the classes yourself... 
maybe able to find a standard one, if writing a classloader seems like too 
much work.
Or you can try my software HARBOR at http://coolese.100free.com/  it allows 
you to control the reloading of classes.

Just out of curiosity, why is it that your beans need to change... why 
couldnt you just have them read from a dB or somthing?


----- Original Message ----- 
From: "SANGAMESHWAR ALLADI" <sa...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Thursday, March 15, 2007 2:02 PM
Subject: how to configure the tomcat to automatically update class instances 
when a class file changed


> hi,
> my class files of beans regularly changes.
> So,everytime i change a class file, i need to restart the tomcat server.
> how can i configure Tomcat to watch the changes in the class files of 
> beans?
>
> Thanks in Advance,
> Sangmaeshwar.A
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org