File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Automatic Class reloading in Tomcat 3.2.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Automatic Class reloading in Tomcat 3.2.3" Watch "Automatic Class reloading in Tomcat 3.2.3" New topic

Automatic Class reloading in Tomcat 3.2.3

DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
Im working on a site that does NOT have it's own instance of tomcat (Im really used to having my own instance) My problem is class file reloading when a change has been made. At this point I am stuck emailing the systems admin. to have them restart the engine but that is getting old real quick! Is there a way to add something to the web.xml file to have 3.2.3 automatically reload classes when a newer version is uploaded. I must admit my XML isnt what it should be so a detailed explanation and maybe some sample code would REALLY help out here. Thanks to all in advance.
sonny kher
Ranch Hand

Joined: Nov 06, 2001
Posts: 83
i know (and maybe u knew this already) that by having the reloadable option in the context declaration in the server.xml file u can get what u want
<Context path="/yourapp" docBase="yourAppDir" reloadable="true">
but u probably cannot edit the server.xml file, i am not sure u can override this in the web.xml file

_ __________________ _ <br />RHCE<br />SCJP<br />??:-(
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
Yes thanks I knew that and yes again I have no access to the server.xml ONLY the web.xml which is why I was asking that question.........thanks anyways
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

And I suppose asking the admin of the site to please change reloadable to true has produced unsatisfactory results?

I'd go guerilla and download the entire site to my local instance, do all my development work on my own Tomcat, and then upload once when it was all done. This of course, means you need FTP access to pull stuff out of WEB-INF, but perhaps that is possible?

Who can say how admins think.
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
Yeah that's what I've been doing but there are always changes that have to be made. I have come up with a stupid way of getting around this for any of those of you that are stuck like 90% of the time. What I do is delete the class file and then try to load the page........of course it crashes and throws an exception. Then I upload the new class file and it does reload.......not a great idea but it usually works and it's better than waiting 8-10 hours for tech support to restart the instance.
madhu gun

Joined: Nov 21, 2001
Posts: 25
I am using Tomcat4.0 as StandAlone but it is Not reloading my servlets or beans (but does for jsp/html) .I have my web-app context in server.xml like this.
<Context path="/test" docBase="examples" debug="0"
Why it is NOT working without RESTARTING the Tomcat.

Can anybody help .
Thanks in advance
I agree. Here's the link:
subject: Automatic Class reloading in Tomcat 3.2.3
It's not a secret anymore!