Bug 38570 - if docBase path contains "webapps", a backslash is inserted
Summary: if docBase path contains "webapps", a backslash is inserted
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.17
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-08 15:46 UTC by Edith
Modified: 2009-06-04 05:48 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edith 2006-02-08 15:46:45 UTC
There seem to be a problem when interpreting docBase in context definitions, if
it contains the string "webapps". 

For testing, I moved tomcat-docs to a separate directory outside of webapps,
then defined a file tomcat-docs.xml in CATALINA_HOME/conf/Catalina/localhost :
<Context
        docBase="${catalina.home}/../something/tomcat-docs">
</Context>

When I name that directory "something" as above, everything works ok,
http://localhost:12345/tomcat-docs displays the documentation (my tomcat runs on
port 12345).

When I name that directory "webappsSomething", it is interpreted as
"webapps/Something" and loading the application (tomcat docu) fails on start of
Tomcat: 

<Context
        docBase="${catalina.home}/../webappsSomething/tomcat-docs">
</Context>

08.02.2006 15:25:30 org.apache.catalina.core.StandardContext resourcesStart
SCHWERWIEGEND: Error starting static Resources
java.lang.IllegalArgumentException: Document base
D:\be\JAVA_IDE\jakarta-tomcat-5.5.9\..\webapps\Something\tomcat-docs does not
exist or is not a readable directory
	at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
	at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3754)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3925)

Apparently Tomcat is fiddling around with the docBase path as soon as it
contains the string webapps - why?
Comment 1 Edith 2006-03-06 16:25:57 UTC
looks like fixed in 5.5.15
Comment 2 Edith 2006-04-19 10:39:10 UTC
Found in 5.5.9, seemed to be fixed in 5.5.15, now in 5.5.17 beta the error is
here again.
Comment 3 Yoav Shapira 2007-03-25 14:05:31 UTC
webapps is the default appBase for the Host, and there's some special processing
that occurs when the docBase includes webapps, if Automatic Application
Deployment is enabled.  Does this still happen to you in 5.5.23?
Comment 4 Kirk True 2008-11-28 17:12:09 UTC
Hmmm... I tried against the trunk, 5.5.27 (current 5.5.x), and 5.5.9 (original reported version) on Linux (Fedora 8) and 5.5.9 on Windows XP (SP3). I can't reproduce the issue using the tomcat-docs.xml provided, the "D:\be\JAVA_IDE\jakarta-tomcat-5.5.9" path, etc.

What am I missing?

Thanks.
Comment 5 Mark Thomas 2009-02-09 11:09:23 UTC
I can recreate this with the latest 5.5.x and the issue appears to be present in trunk and 6.0.x as well. I have applied the necessary fix to trunk and proposed it for 6.0.x and 5.5.x
Comment 6 Mark Thomas 2009-03-06 06:47:54 UTC
This has been fixed in 6.0.x and will be included in 6.0.19 onwards.
Comment 7 Mark Thomas 2009-06-04 05:48:26 UTC
This has been fixed in 5.5.x and will be included in 5.5.28 onwards.