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.
The choice is yours. You can either continue debugging and/or wait for a few anecdotal responses. I'd uninstall tomcat, then reinstall it.
Joined: Aug 12, 2009
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.
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.
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.