aspose file tools*
The moose likes Tomcat and the fly likes Servlet reloading in Tomcat 3.2.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet reloading in Tomcat 3.2.4" Watch "Servlet reloading in Tomcat 3.2.4" New topic
Author

Servlet reloading in Tomcat 3.2.4

Lon Allen
Ranch Hand

Joined: May 24, 2001
Posts: 67
Does Tomcat 3.2.4 support servlet reloading? I see in Moreservlets.com's instructions on setting up Tomcat 4 that there is a mechanism to do this, but I can't determine if Tomcat 3.2.4 can do it too.
At the moment the only way I can get my changes to the application to take effect is to shut down the server, delete the entire app directory and the war file in the webapps directory, copy in the new war file and restart the server. Is there an easier way to deploy changes to an application using Tomcat 3.2.4?
Lon Allen
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
I'm using Tomcat 3.2 and its reloading the changed servlets and jsp without restarting the server. Very rarely it won't.
Try to add the attribute reloadable="true"in your context.for example
<Context path="/examples"
docBase="webapps/examples"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
If still problem persist,better upgradte to newer version(if possible).


Spritle Software Blogs
Jesse Beaumont
Ranch Hand

Joined: May 30, 2002
Posts: 43
Tomcat 3.2 does support class reloading but it is flaky at best. Servlets tend to be picked up if you specify the reloadable="true" option as Balaji said.
Classes deeper in the package tree won't necessarily though. Also on rare occasions the reloading fails which, when debugging, really gets confusing (as you try and find out why the bug you have just fixed is still appearing).
The other problem is that under tomcat 3.2 the servlet context and session objects don't properly carry across when reloading servlets so if you are using session state or servlet contexts (init parameters, etc) things may go funny when the servlet gets reloaded.


---<br />Time flies like an arrow,<br />Fruit flies like a banana
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Has this been changed in 4.x? I'm using the "reload" and it doesn't work at all. I see a system.out message that if found the changed file, but it dies when the browser hits it...
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by David Yutzy:
Has this been changed in 4.x? I'm using the "reload" and it doesn't work at all. I see a system.out message that if found the changed file, but it dies when the browser hits it...

For me its working fine on both Tomcat 3.2.4 and 4.x,
I'm using jdk1.3.1,win2k professional,
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92),
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode),
As i said,very rarely it won't.
Try again the configuration and Good luck
achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Hi.
I am using 4.0.4 with reloadable="true".
It works intermittantly when used in ernest.
So when I am unsure shutdown, then startup again.


humanum errare est.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet reloading in Tomcat 3.2.4