tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Dockery" <>
Subject manager undeploy task failing with "cannot remove document root"
Date Wed, 30 Apr 2003 07:44:51 GMT
I've been having a problem with the undeploy task failing.

I traced the problem down into the undeploy method of the ManagerServlet
class in the org.apache.catalina.servlets package.

The message is thrown back because the absolute docBase is determined to be
invalid by the following (excerpt) of code (approx. line 1206-1218):

            // Validate the docBase path of this application
            String deployedPath = deployed.getCanonicalPath();
            String docBase = context.getDocBase();
            File docBaseDir = new File(docBase);
            if (!docBaseDir.isAbsolute()) {
                docBaseDir = new File(appBaseDir, docBase);
            String docBasePath = docBaseDir.getCanonicalPath();
            if (!docBasePath.startsWith(deployedPath)) {

Can someone walk me through the semantics of this code segment?  Does the
docBase end up being $TOMCAT_HOME/work/.../.../mycontext or

I see in the init method that the member variable deployed is initialized to
(what I believe to be) the value of $TOMCAT_HOME/work.   If that is the
case, then won't the startsWith test always fail as
$TOMCAT_HOME/webapps/mycontext will never start with $TOMCAT_HOME/work?
What have I assumed incorrectly?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message