You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2019/10/22 06:56:38 UTC
[Bug 63872] New: ContextConfig -> Invalid docBase if the exploded
war is a sym-link
https://bz.apache.org/bugzilla/show_bug.cgi?id=63872
Bug ID: 63872
Summary: ContextConfig -> Invalid docBase if the exploded war
is a sym-link
Product: Tomcat 8
Version: 8.5.35
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: kilian.felder@nextstride.com
Target Milestone: ----
The sym-link was working until version 8.5.34, but since 8.5.35 and higher it
does not work anymore.
This problem has been reported in Bug #60022 and should be fixed!
Somewhere I found a link where this problem has been discussed again ->
http://tomcat.10.x6.nabble.com/Followup2-Changed-behaviour-of-Tomcat-Deployment-Context-Lifecycle-Manager-concerning-symbolic-links-td5083666.html
The cause is located within the ContextConfig class.
diff ContextConfig.java-8.5.34 ContextConfig.java-8.5.35
:
582c586
< docBase = (new File(appBase, docBase)).getPath();
---
> docBase = (new File(appBase, docBase)).getCanonicalPath();
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 63872] ContextConfig -> Invalid docBase if the exploded war is
a sym-link
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63872
--- Comment #2 from Steve Sanders <st...@gmail.com> ---
(In reply to Kilian Felder from comment #1)
> user@testsystem:/path/to/instance/webapps $ ls -l
> :
> lrwxrwxrwx ... myapp.war -> MyApp-4.10.5.0.war.r2308mod-20191017-2100
> -rw-rw---- ... MyApp-4.10.5.0.war.r2308mod-20191017-2100
> :
> It's not working this way (but was possible until 8.5.34). Here I point with
> the symlink to the war-file which is in the webapps directory itself, and it
> must not have the .war suffix because otherwise it would be exploded twice.
>
> user@testsystem:/path/to/instance/webapps $ ls -l
> :
> lrwxrwxrwx ... myapp.war ->
> ../MyApp-4.10.5.0.war.r2308mod-20191017-2100.war
> :
> It's working when I place the war-file one level higher and add the .war
> suffix!
>
> Why do you check for the .war suffix? When it's required to check for the
> .war suffix you should do this maybe better before the call to
> getCanonicalPath().
Looks like this got added in to ensure consistency of behavior according to the
changelog. If I'm not mistaken though, the .war file extension has been
requirement for very long time. It feels to me (a user not a contributor) that
you were sort of abusing a bug to deploy your application this way in the past.
I'm assuming your aim here is to deploy your application with a different
context root than what the actual file name is, so you use a symlink to give it
the context you want. If thats correct - why not use META-INF/context.xml to
define the context you want here?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 63872] ContextConfig -> Invalid docBase if the exploded war is
a sym-link
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63872
Kilian Felder <ki...@nextstride.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|8.5.35 |8.5.47
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 63872] ContextConfig -> Invalid docBase if the exploded war is
a sym-link
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63872
--- Comment #3 from Steve Sanders <st...@gmail.com> ---
(In reply to Steve Sanders from comment #2)
> (In reply to Kilian Felder from comment #1)
> > user@testsystem:/path/to/instance/webapps $ ls -l
> > :
> > lrwxrwxrwx ... myapp.war -> MyApp-4.10.5.0.war.r2308mod-20191017-2100
> > -rw-rw---- ... MyApp-4.10.5.0.war.r2308mod-20191017-2100
> > :
> > It's not working this way (but was possible until 8.5.34). Here I point with
> > the symlink to the war-file which is in the webapps directory itself, and it
> > must not have the .war suffix because otherwise it would be exploded twice.
> >
> > user@testsystem:/path/to/instance/webapps $ ls -l
> > :
> > lrwxrwxrwx ... myapp.war ->
> > ../MyApp-4.10.5.0.war.r2308mod-20191017-2100.war
> > :
> > It's working when I place the war-file one level higher and add the .war
> > suffix!
> >
> > Why do you check for the .war suffix? When it's required to check for the
> > .war suffix you should do this maybe better before the call to
> > getCanonicalPath().
>
> Looks like this got added in to ensure consistency of behavior according to
> the changelog. If I'm not mistaken though, the .war file extension has been
> requirement for very long time. It feels to me (a user not a contributor)
> that you were sort of abusing a bug to deploy your application this way in
> the past.
>
> I'm assuming your aim here is to deploy your application with a different
> context root than what the actual file name is, so you use a symlink to give
> it the context you want. If thats correct - why not use META-INF/context.xml
> to define the context you want here?
Dug a bit deeper here - and my feelings on the use case aside - it is valid. It
also appears to have been fixed in 9.0.20. I'm uncertain if there are plans to
backport it to 8.5.X or not. But looking at the code, I THINK its possible to
do.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 63872] ContextConfig -> Invalid docBase if the exploded war is
a sym-link
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63872
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Mark Thomas <ma...@apache.org> ---
Thanks for the report.
Fixed in 8.5.x for 8.5.48 onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 63872] ContextConfig -> Invalid docBase if the exploded war is
a sym-link
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63872
--- Comment #1 from Kilian Felder <ki...@nextstride.com> ---
user@testsystem:/path/to/instance/webapps $ ls -l
:
lrwxrwxrwx ... myapp.war -> MyApp-4.10.5.0.war.r2308mod-20191017-2100
-rw-rw---- ... MyApp-4.10.5.0.war.r2308mod-20191017-2100
:
It's not working this way (but was possible until 8.5.34). Here I point with
the symlink to the war-file which is in the webapps directory itself, and it
must not have the .war suffix because otherwise it would be exploded twice.
user@testsystem:/path/to/instance/webapps $ ls -l
:
lrwxrwxrwx ... myapp.war -> ../MyApp-4.10.5.0.war.r2308mod-20191017-2100.war
:
It's working when I place the war-file one level higher and add the .war
suffix!
Why do you check for the .war suffix? When it's required to check for the .war
suffix you should do this maybe better before the call to getCanonicalPath().
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org