'Why does webapp specific context in tomcat 10 no longer work?
My application (SimpleWebApp) needs some context parameters defined. I have a SimpleWebApp.xml
context file with the following content:
<Context>
<Parameter name="MYSIMPLEWORKDIR" value="/data/Apps/SimpleWebApp" override="1"/>
</Context>
This file is placed in ${TOMCAT_HOME}/conf/Catalina/localhost/SimpleWebApp.xml
.
In tomcat 9 (9.0.62) this works perfectly. When tomcat starts, it logs the following line:
org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/opt/tomcat/conf/Catalina/localhost/SimpleWebApp.xml]
My application starts and the Property is available to the application (what I can see, because my application is able to load configuration files from that directory).
I updated to tomcat 10 (10.0.20) and now my application does not work anymore. Tomcat logs the same line as mentioned above on startup but the property MYSIMPLEWORKDIR
is not set (what I can see, because my application resolves the property to null).
I checked the tomcat documentation about context configuration in tomcat 10 and compared it to tomcat 9 but there are no differences. I also checkend the changelogs but did not find anything about changes in this area.
Did someone maybe discover the same problem and already found a solution?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|