https://bz.apache.org/bugzilla/show_bug.cgi?id=66527

--- Comment #3 from Zach DeLuca <zadel...@gmail.com> ---
(In reply to Mark Thomas from comment #1)
> I did look at the possibility of supporting a relative path but that begs
> the question "Relative to what?". CATALINA_BASE isn't an option as that is
> (usually) created dynamically when using the Tomcat class.
Funny enough, I actually discovered the issue when specifying a fixed
CATALINA_BASE (setting server.tomcat.basedir with Spring Boot).

For example, if CATALINA_BASE=/foo and /foo/webapps/bar exists, then
addWebApp("/bar", "bar") actually works just fine.

The only issue that appeared was NoSuchFileException stemming from
getWebappConfigFile interpreting "bar" as absolute when trying to locate
context.xml as I mentioned in the original post. Otherwise, the app works (as I
have no context.xml anyway).

I think this works because of the underlying Context object, which says this
for setDocBase(String):

> Set the document root for this Context. This can be either an absolute 
> pathname or
> a relative pathname. Relative pathnames are relative to the containing Host's 
> appBase.
So I guess "Relative to what?" is sort of explained?

But anyway, using an absolute path is easy enough for me. Plus it has the added
benefit I hadn't considered until now, that you can load from any path and it
doesn't need to be underneath an existing CATALINA_BASE.

Thank you for clearing this up.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to