Bug 32603

Summary: Tomcat documentation wrong
Product: Tomcat 5 Reporter: N. Flucke <flucke>
Component: UnknownAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.0.27   
Target Milestone: ---   
Hardware: All   
OS: All   

Description N. Flucke 2004-12-09 11:45:42 UTC
I found out that the appBase-attribute (server.xml) is not relative to
$CATALINA_HOME. It's relative to $CATALINA_BASE unless it's specified an
absolute pathname.
In the documentation
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html you write for
the appBase-attribute: "...You may specify an absolute pathname for this
directory, or a pathname that is relative to the $CATALINA_HOME directory..."
But in the sourcecode of HostConfig.java I found this:    
  protected File appBase() {
        if (appBase != null) {
            return appBase;
        }
        File file = new File(host.getAppBase());
        if (!file.isAbsolute())
            file = new File(System.getProperty("catalina.base"),
                            host.getAppBase());
        try {
            appBase = file.getCanonicalFile();
        } catch (IOException e) {
            appBase = file;
        }
        return (appBase);
    }

It should be correct in the documentation, because it's bit confusing.
I tested it with Tomcat 5.0.27 but I check the actual code in CVS, it's the same.
Comment 1 Yoav Shapira 2004-12-09 14:47:05 UTC
Fixed for 5.0.31 and 5.5.6.  Thanks for pointing this out.