tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lewis <m...@wingateweb.com>
Subject ContextManager loads incorrectly
Date Wed, 01 Nov 2000 22:58:10 GMT
I'm not a regular contributor to the devel mailing list, but I tracked
down a problem I've experienced to a quirk (bug?) in the Tomcat 3.2beta6
source code and I thought I would post it here so that the powers that
be can decide whether the code needs to be patched or not.

When loading the ContextManager configuration from the server.xml file,
the work directory may not be correctly loaded.  When the ContextManager
tag has the attributes in this order:

<ContextManager workDir="work" home="/web/staging/tomcat_home"  ... >

The XmlMapper calls ContextManager.setWorkDir() and then
ContextManager.setHome().  The problem is, workDir is supposed to be
based on the 'home' attribute.  Since the setWorkDir() method sets the
workDir as 'home' + param, if setHome() hasn't been called yet the work
directory will not reflect the home attribute.

Note that if you specify the attributes in the opposite order, the
functions are called in the correct order and everybody is happy.

The fix could be either:

1) Store the work dir specified in the config file in ContextManager,
and recalculate the workDir attribute any time home is set.

2) Recalculate workDir everytime you call getWorkDir()    (I believe
this is what Tomcat 3.1 did, so it behaved correctly)

3) Specify that you need to put the "home" attribute first in the
ContextManager XML tag.

Hopefully this is useful, and I wasn't wasting your guys' time. :)

Mark Lewis
mark@wingateweb.com


Mime
View raw message