aspose file tools*
The moose likes Tomcat and the fly likes How can I force Tomcat 5.5 to clear it's cache of web apps? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How can I force Tomcat 5.5 to clear it Watch "How can I force Tomcat 5.5 to clear it New topic
Author

How can I force Tomcat 5.5 to clear it's cache of web apps?

Alex Ryan
Greenhorn

Joined: Aug 12, 2009
Posts: 14
I usually deploy web apps to my production server in expanded form so that I can edit the context.xml file to point to my production database instead of my development one.
However, I accidentally deployed a war file and now I seem to be somewhat screwed.
Tomcat seems to have cached the information in the context.xml file and now I can't deploy.
Even though both the war file and the expanded directory have been physically deleted from webapps directory, catalina.out still shows that tomcat is trying to load them and finding errors in the context files.
I tried putting new war files in the webapps directory, but Tomcat ignores them for some reason.
I'm not sure where Tomcat is caching this information but I think I need a way to make Tomcat clear its cache so that to can load the new versions that I am deploying to the webapps directory.
Restarting and rebooting did not help.
Anybody have any ideas?

P.S. Just to make it concrete, here is what I am seeing in catalina.out ..

INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/quotations] has not been started
May 15, 2010 4:34:05 AM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /usr/java/apache-tomcat-5.5.17/webapps/iVote does not exist or is not a readable directory

This information was contained in a context.xml file inside of a quotations web app which has been physically deleted.
It's trying to start a web app with bad config that no longer exists and is ignoring the new versions that I deploy.
Charles 'King
Ranch Hand

Joined: Jul 05, 2009
Posts: 56

The choice is yours. You can either continue debugging and/or wait for a few anecdotal responses. I'd uninstall tomcat, then reinstall it.
Alex Ryan
Greenhorn

Joined: Aug 12, 2009
Posts: 14
Thanks Charles.
I tried that.
Unfortunately it seems that fedora's un-install does not wipe out the cache because the problem is still there after a re-install.
I also tried going into the admin tool and physically deleting the context there.
But it keeps coming back. LOL.
Methinks somebody on the tomcat dev team has an interesting sense of humor.

If anybody has a solution to this problem I'd very much appreciate it.
I'm at the point now where the only way I know how to deploy a simply web app to tomcat is to re-install my entire operating system.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
If this was my problem I would be doing a file search for the text "iVote"

I would also be looking for a directory named "iVote" somewhere where Tomcat can see it.

Bill

Java Resources at www.wbrogden.com
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Try to delete Tomcat's 'work' directory
Alex Ryan
Greenhorn

Joined: Aug 12, 2009
Posts: 14
Thank you for the helpful suggestions.
catalina.out gave me a hint as to where the information was being cached.
There were multiple cached versions of the context.xml file in /etc/tomcat5/Catalina/localhost/
I'm guessing that this is the work directory?
Anyways, deleting these files made my problem go away.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60074
    
  65

Did you mean tomcat5/conf/Catalina/localhost/ ?

And no, that's not the work folder. That's the folder where Tomcat will store the context definition files for your web apps. This file is an important part of your web app that you should be creating when deploying the web app. As you've noticed Tomcat will create one if it auto-deploys an app if you do not create it yourself.

You should familiarize yourself with the use of this file and understand how Tomcat uses it to map web applications to their context paths.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alex Ryan
Greenhorn

Joined: Aug 12, 2009
Posts: 14
Thanks for the info Bear.
Much appreciated.
P.S. *Loved* the jQuery in Action book. It's one of my faves. Very well written.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60074
    
  65

Thanks Alex!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I force Tomcat 5.5 to clear it's cache of web apps?
 
Similar Threads
Can't write Context element properly
Context in server
FileNotFoundException during deploy
Configuring JNDI for JavaBean in Tomcat 5
Eclipse + Lomboz problem