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

Vista caching and Tomcat

steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
I'm having a problem with Tomcat and Vista - it appears that files are getting cached, so that if I edit a file in place (under Tomcat webapps), and then refresh in the browser, I still get the old version of the page. Related, I can't get a directory listing even though I set listings to true in Tomcat's conf/web.xml (which I tried when it occurred to me that I could save as, change the file name, and view under the new name to at least get a start at resolving this - which BTW gave me a 404 until I restarted the server).

I suspect that this is a Vista issue more than a Tomcat problem, but has anyone encountered this and come up with a solution?
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
If you change something on your web-app (e.g. class files), you need to republish them. The container does that automatically when you restart.

As for caching, CTRL+R refreshes without using the cache.


JDBCSupport - An easy to use, light-weight JDBC framework -
steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
Actually, I misspoke (miswrote?). I don't see the new file, or my revised content in the browser, even after restarting Tomcat (and trying various tricks like appending ?junk=1 to the URL to force a unique URL). It seems that Tomcat is locked into using the files that were in place when I first copied the whole shebang into webapps.

And, since it is an obvious question, I have more than triple-checked that I am indeed editing the correct files.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18902
    
    8

Just to clarify, the "Vista" connection is that Tomcat is running under Vista, right? Not that those browsers are running under Vista?
steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
Right - the server is on Vista.

Also, thanks to whoever moved this post - I didn't realize that this forum existed, but it is certainly a better place for it.
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
This issue pure Tomcat. The pages stuck in the servlet container and are not refreshed there. Try clearing out the compiled files or all of the files from under the //work/... directory. I do not exactly remember where under work but there is also a directory by the name of localhost and "_"... you should go all the way down the tree till you find your files. Just clear the files you know belong to you and no need to restart Tomcat.
I started learning creating web-apps on notepad and tomcat, and experienced this problem a lot often.

Regards


Experience and talent are independent of age
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

In addition to clearing the work directory are you *sure* you're editing the correct files? I've never had this problem on Vista.
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
Here is the path:
${CATALINA_HOME}\work\Catalina\localhost

You would see your application folder under localhost. Else under the folder "_".

Regards
steve claflin
Ranch Hand

Joined: Dec 04, 2008
Posts: 54
OK, problem resolved, more or less.

Apparently the problem is indeed with Vista, something called User Access Control (aka UAC). It seems to stifle changes to files under Program Files, so that the state of the Tomcat installation was locked in as it had been when first created (although that doesn't explain why I was able to create the webapp the first time). As mentioned earlier, even a change to Tomcat's web.xml did not "take".

So, we used Tomcat from the zip distribution (as opposed to the service installer), unzipped to a location outside of Program Files, and now everything works as expected.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Vista caching and Tomcat