This is because such an application context does not exist with the name context. In other words, there is no web application with a name context deployed in the webapps directory.
Create official Tomcat 7 documentation related to Context Definition :
Individual context elements can be explicitly defined:
In a separate file in the / META -INF / context.xml file inside the application files. Optionally (based on the Host copyXML attribute) this can be copied to $ CATALINA_BASE / conf / [enginename] / [hostname] / and renamed to the name of the base application file plus the extension ".xml".
In separate files (with the extension ".xml") in the $ CATALINA_BASE / conf / [enginename] / [hostname] / directory. The context path and version will be obtained from the base file name (the file name is less than the .xml extension) . This file will always take precedence over any context.xml file packaged in the META-INF Directory web application.
Inside the Host element in the main conf / server.xml.
So for it to work, name your custom file, not context.xml, but your_app_name.xml .
In your case, it will be (if I understand you correctly) myapp.xml .
That should work. I just tested it.
myApp.xml
<?xml version="1.0" encoding="UTF-8"?> <Context> <Parameter name="port" value="100" override="1"/> </Context>
PS
And you can get without a path attribute, so don't include it.
From the Apache Tomcat 7 documentation :
This attribute should only be used with a static Context definition in server.xml . In all other circumstances, the path will be inferred from the file names used for the .xml or docBase context file.
Even with a static Context definition in server.xml, this attribute should not be set if either docBase is not under Host appBase or both deployOnStartup and autoDeploy are false . If this rule is not respected, a double deployment may occur.
source share