Bug 32505

Summary: Deploy of a file url fails
Product: Tomcat 5 Reporter: Tim Schafer <tschafer>
Component: Webapps:ManagerAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.5.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Tim Schafer 2004-12-02 23:46:33 UTC
Using tomcat 5.0.27 I can use the manager app to deploy another app
that is in a directory on my local computer by secifying the dir as a file url
in the text entry labeled WAR or Directory URL:
file://c:\cvs\kls-war

In tomcat 5.5.4 this fails with:
FAIL - Invalid context path  was specified
when I do not specify a context path.

When I do specify a context path:
/kls
a diretory is created in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost
called
kls.xml
in that directory looks like the beggining of a copy of my c:\ dir
but the app is not deployed
Comment 1 Remy Maucherat 2004-12-02 23:54:24 UTC
This will not be fixed.

*** This bug has been marked as a duplicate of 32418 ***
Comment 2 Tim Schafer 2004-12-03 00:23:41 UTC
Why?

And if the bug isn't going to fixed, then why does the manager still support
providing a URL to a directory?


I can still deploy a webapp already in exploded form by manually putting a
context xml file in conf\Catalina\localhost

It is very useful for development to deploy a webapp being worked on in place.
Why has the manager been cutback?
Comment 3 Remy Maucherat 2004-12-03 16:03:06 UTC
Ok. You need to write simpler stuff in bug reports when you can, so that the
issues cannot be confused. I will adress the issue.
Comment 4 Remy Maucherat 2004-12-06 17:01:53 UTC
I thought I had marked this as fixed earlier. Odd.
The problem was that the context attribute was not handled properly if it was
present but empty (and since an empty path is the root of the filesystem, at
least on Windows ...). The patch is very simple.

  RCS file:
/home/cvs/jakarta-tomcat-catalina/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ManagerServlet.java	23 Sep 2004 07:03:27 -0000	1.22
  +++ ManagerServlet.java	3 Dec 2004 15:35:25 -0000	1.23
  @@ -737,6 +737,9 @@
       protected void deploy(PrintWriter writer, String config,
               String path, String war, boolean update) {
           
  +        if (config != null && config.length() == 0) {
  +            config = null;
  +        }
           if (war != null && war.length() == 0) {
               war = null;
           }