I'm trying to deploy a war file in the webapps folder of tomcat 9. But I want my application to be loaded at the startup, not the tomcat default page. So I configured docBase in the Context tag in server.xml to point to my application like this:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="MyApp/UI/"></Context>
...
</Host>
But on the startup of tomcat server, it is giving an error message that MyApp/UI/ is not found, as the unpack of war file wouldn't have happened. So I'm commenting the Context tag and starting the server, then it is working well. Once it starts working I'm adding the Context tag so that on startup MyApp/UI/ will be loaded.
How to solve this issue? Like, is there any conditional Context tag that can be given in server.xml, so that it considers Context tag up on certain condition.
Please help me solving this issue. Thanks in advance.