tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Dockery" <s...@sbdconsultants.com>
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.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12643

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)) {
                writer.println(sm.getString("managerServlet.noDocBase",
                                            displayPath));
                return;
            }

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

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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message