Problem phenomenon: Every time tomcat is started, the Java code will be loaded twice. If there is a timer-like business, the timer will also have two copies running, which will affect the business.
mm.war is under tomcat/webapps . The configuration of tomcat/conf/server.xml is as follows:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="mm" reloadable="false" />
</Host>
After Tomcat starts, it will automatically decompress mm.war into mm folder.
In this way , appBase="webapps" in Host will make tomcat load all directories under tomcat/webapps , including mm . The access path is http://192.168.0.1/mm .
The docBase="mm" in the Context will make tomcat load the mm directory under the webapp , and the access path is: http://192.168.0.1/ .
It is equivalent to loading a project twice.
Solution: delete the Context node