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();
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().
(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?
(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.
Thanks for the report. Fixed in 8.5.x for 8.5.48 onwards.