I already read a number of related questions, but i did not get to a solution for my situation.
I have a webapp in a war-file that includes the version number. E.g.,sourceWarName.war. I cannot use remote deployment, the war file will be deployed manually over the tomcat manager web-interface. I would like the webapp to be accessible over a static path (decoupled from the version), e.g, http://someserver:8080/targetPath As specified in tomcat docs and stack overflow question, it is possible to create a context.xml in my application's META-INF folder like this:
<Context path="targetPath" debug="0" reloadable="true">
...
</Context>
The file is then supposed to be copied to /tomcat7/conf/Cataline/localhost/sourceWarName-1.0.0.xml. This does not work, however. No xml file is copied. I configured the host-entry in the server.xml to make sure we do not run into double-deployment like this:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false" deployOnStartUp="false" copyXml="true">
The app, however, is still reachable under /sourceWarName-1.0.0. What did i miss?
I tried the answer to this question, but this did not work out for me. Only difference seems to be the docBase. Tomcat doc says about docBase:
The value of this field must not be set unless the Context element is defined in server.xml or the docBase is not located under the Host's appBase.
I do not have a context element in server.xml and the appBase is the same. Running Apache Tomcat/7.0.52 (Ubuntu).