File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Automatically Reloading Servlets in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Automatically Reloading Servlets in tomcat" Watch "Automatically Reloading Servlets in tomcat" New topic
Author

Automatically Reloading Servlets in tomcat

Afroz Ahmed
Ranch Hand

Joined: Jan 18, 2004
Posts: 64
Hello All,

I am a learner.I want my tomcat 4.1 to automatically reload my servlet class when it was changed.

This is my server.xml file contents line for my appl

<Context path="/app" docBase="e:/progra~1/Tomcat_app/webapps/app1" debug="0"
reloadable="true" crossContext="true">

Later I also added DefaultContext element to host element.

<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<DefaultContext reloadable="true"/>

When i do changes to my servlet and do compilation,replace the files,the tomcat is not taking the changes.When i restart the tomcat, then the changes were working fine.

Pl tell me what was the problem or show me the correct way to do it.

Thanks.


The value of an idea lies in the usage of it.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12681
    
    5
Personally I use the Tomcat Management Application - it lets you unload and reload a specific web application. According to the specs, reloadable="true" should work by monitoring the timestamps on the .class and .jar files - I dunno why it doesn't in some installations.
Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

There are some known problems in Tomcat 4 (specifically with 4.1.27 if I recall) with reloading. Tomcat 5 seems to have solved these issues (and I believe there is a patch for 4.1.27 but I can't vouch for it).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Afroz Ahmed
Ranch Hand

Joined: Jan 18, 2004
Posts: 64
Thanks.

I will try with the Tomcat Manager Application.How to configure for that.

Later,I will do my appl in tomcat 5.

Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Automatically Reloading Servlets in tomcat
 
Similar Threads
Servlet reload Problem
servlet not reloading on Tomcat 4.0
Is Tomcat needs to be run everytime the Servlet Changes
How to configure context.xml in tomcat/config
How to configure context.xml in tomcat/config