When I set docBase in context tag to relative path it is not possible to have more then one Context with same docBase. For example We have two XML files for our application in folder Catalina/localhost. iis.xml and iisstampa.xml. Both of them have the same docBase="iis". appBase is set to webbaps in Host tag in server.xml. iis.xml is loaded corectly, but iisstampa.xml is not. This is because inside of method org.apache.catalina.startup.HostConfig.deployDescriptor there is part that recognizes that {tomcat_home}/webapps/iis folder is inside of appBase an docBase attribute is ignored by calling context.setDocBase(null). This causes Tomcat looks for folder iisstampa inside of appbase which of course does not exist. If we put this context and docBase outside appBase everything works corectly. But described situation is in conflict with documentation because it is not possible to have multiple instances of same docBase if the docBase is inside appBase. This behavour is introduced in revision SVN 303926 of Tomcat 5.5 by remm (Remy Maucherat) as a solution of bug 34840 to recognize if the context path is external. This bug exists on Tomcat 7 also. We experinced this bug during migration from tomcat 5.5.4 to Tomcat 6 so this is reason reporting in Tomcat 6 section.
This is working as designed. If you need further assistance, please use the users mailing list.
(In reply to comment #1) > This is working as designed. If you need further assistance, please use the > users mailing list. But in documentation for Context tag it is written The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host. If I have only one xml file in example above called iisstampa.xml with docBase=iis. Message A docBase /home/programi/tomcat/webapps/iis inside the host appBase has been specified, and will be ignored. Then Tomcat looks for folder iisstampa under webapps folder which does not exist and the context is not loaded. So there is no possibility to have docBase set relative to appBase because every relative path is ignored.
Patches to the documentation are welcome.
I have updated the docs. The update will be included in 7.0.7 onwards.
The documentation patch has been applied to Tomcat 6 as well, along with further clarifications added later. It will be in 6.0.37.