Comment 11 for bug 1820288

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for all the debugging Christian! Very useful :)

I also did some investigation and this behavior is expected by the Debian maintainers. According to the maintainers the current implementation does not support using copyXML=true, because in this case when the app is deployed the context file in APP/META-INF/context.xml is copied into /etc/tomcat8/Catalina/localhost. The Debian maintainers believe the copyXML=true option is not that useful and they would accept a good use case to justify making /etc/tomcat8/Catalina/localhost writable by tomcat. They also acknowledged that tomcat should not create files in /etc during runtime, so they changed the way it works in tomcat9.

The use case Arnaud presented in the bug description was very well defined and it is reproducible (thanks!). However, there is a simple workaround for this in Bionic if you do not use the admin web interface to deploy it. You can edit the hello.xml file in the root of the attached zip file and leave it like this:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/tmp/hello.war">
 <Parameter name="helloMessage" value="Everything is ok" override="1" />
</Context>

Note I added docBase="/tmp/hello.war" in the Context tag. After that you copy it to /etc/tomcat8/Catalina/localhost/ and restart tomcat. Then you can access https://IP_ADDRESS:8080/hello/hello and see "Everything is ok".

Feel free to engage with the Debian maintainers on this discussion. If you come up with a solution we can discuss about a SRU.