S
S
Sergey_USB2021-09-11 11:33:20
tomcat
Sergey_USB, 2021-09-11 11:33:20

Starting and restarting an application in Tomcat 9 how to do?

Colleagues,
good day.
I want to create a folder mytestapp in Tomcat in the webapps folder.
War with the application that he would take from the myapp_1 folder, which is also in the webapps folder.
And the properties for the application were taken from the myapp_1 folder.
When throwing a new war into the myapp_1 folder - the contents were overwritten - the application was restarted.

<Host name="mytestapp" appBase="webapps" autoDeploy="true">
    <Context path="/mytestapp" docBase="c:/Apache-tomcat/webapps/myapp_1/mytestapp.war" debug="0" reloadable="true">
    <Environment name="spring.config.location" value="file:c:/Apache-tomcat/webapps/myapp_1/application.properties" type="java.lang.String"/>
    </Context>
    </Host>


I add the code above to server.xml.
it only fires once - if the mytestapp folder is not there. He does everything as I plan.
But if he has already done it once, then he does nothing else. That is, if I drop the myapp_1 folder with a new war with a new version, then the application does not start again and the files are not updated.
If you throw a new war and restart Tomcat, then it also does not change anything, and even if you delete all the contents from the mytestapp folder, nothing happens either.
In short, it works as I want only once - if everything is deleted on the switched off Tomcate and restarted.
How to fix this situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question