Bug 40050 - context XML file deleted when path is not readable
Summary: context XML file deleted when path is not readable
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.9
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2006-07-14 21:11 UTC by John Mulhollen
Modified: 2009-02-09 11:45 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description John Mulhollen 2006-07-14 21:11:16 UTC
we have created a virtual directory on \\\Recordings and have placed
an xml file (recordings.xml) in $APACHEDIR\conf\catalina\localhost on our web
server ( When is rebooted, or goes off-network, the
webserver reports the directory as unreadable (error message below) AND THEN
DELETES RECORDINGS.XML. Needless to say, this isn't desired behavior.

java.lang.IllegalArgumentException: Document base \\\Recordings does
not exist or is not a readable directory
SEVERE: Context [/Recordings] startup failed due to previous errors
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Recordings] has
not been started
Comment 1 John Mulhollen 2006-07-14 22:27:51 UTC
the contents of recordings.xml:

<Context path="/Recordings" docBase="//" debug="0"
reloadable="true" />
Comment 2 Yoav Shapira 2006-12-26 05:17:04 UTC
Agreed this is bad behavior.  Oddly enough, I can't seem to find that error
message in the current code.  So the code must have changed.
Comment 3 Yoav Shapira 2006-12-26 05:20:20 UTC
Do you have the anti(Resource|JAR)Locking flag enabled?  I see a place in
org.apache.catalina.startup.ContextConfig#antiLocking (line 964 in current SVN
version of code) that deletes the docBase file.

These two flags are false by default, so you probably don't have them enabled,
but I still wanted to ask.  (See
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html for the
configuration explanation of these two flags).

Also, if you wouldn't mind testing on v5.5.20, the latest stable release, that'd
be awesome.
Comment 4 Chris Halstead 2007-01-11 14:45:38 UTC
I tried to repro this on 5.5.20 with no success.

I created a standalone webapp directory (in ${CATALINA_BASE}/test) and a context
file (under ${CATALINA_BASE}/conf/Catalina/localhost) that referenced it.  I
included 'path' and 'reloadable' attributes as in the OP's post.  I then tested
initial deployment and redeployment of the webapp with the webapp directory both
readable and unreadable by the tomcat process user.

In all circumstances when the webapp was unreadable the webapp failed to deploy
(or redeploy) with an IllegalArgumentException, but the context file was never
deleted.  Using antiresource/jar locking made no difference.
Comment 5 Mark Thomas 2009-02-09 11:45:11 UTC
You need to turn off autoDeploy. If Tomcat detects that a war or dir has been deleted and autoDeploy="true" it will undeploy (ie delete) all the associated resources, including the context.xml file.