views:

85

answers:

2

I have a download service served using Tomcat 5.5.15. It is created by adding an XML file in $TOMCAT_HOME/conf/Catalina/localhost. E.g downloads.xml for http://example.com/app.downloads/

<Context path="/app.downloads" docBase="Z:\Sites\example.com\downloads\"/>

After Tomcat restart the context file is sometimes deleted(not always), and i have to manually recreate the file.

What could be the problem? Is there a was of fixing it?

+1  A: 

That is not the normal case. I also don't expect that you're deploying a WAR for a simple download service. I think that your Tomcat instance is controlled by something else, for example an IDE such as Eclipse. You shouldn't do that for production as well. If you run Tomcat standalone, the problem should be solved.

BalusC
tomcat is running as a standalone install (no string attached).
n002213f
Then I don't see any other option than declaring it inside `<host>` of `server.xml`.
BalusC
.. or upgrading to Tomcat 6.0. It works fine here.
BalusC
A: 

This is a bug in Tomcat. I filed a report for Tomcat 5 but the fix is complicated.

The file is removed during re-deploy, not restart. So you need to make sure your app doesn't get re-deployed. Don't change your app while server is running.

ZZ Coder
is it possible to send me the fix?
n002213f
No. The problem is complicated. Tomcat is confused between 3 different deployment modes (Fragment, WAR, directory) and it requires changes in many places to fix it. So I never came up with a patch. Until a fix, don't use this deployment method in production.
ZZ Coder