• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Automatically Reloading Servlets in tomcat

 
Afroz Ahmed
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Afroz Ahmed
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic