你可以试试这个: 启动命令行你的tomcat:
bin/startup -app.unloadingDelay 60000
修改conf/context.xml文件,并使用上述房产:
<Context unloadDelay="${app.unloadingDelay}">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
不要使用任何关键字或属性作为属性名称。 参考: https://tomcat.apache.org/tomcat-7.0-doc/config/index.html
Tomcat配置文件被格式化为无模式XML;元素和属性区分大小写。支持Apache Ant式变量替换;具有名称propname的系统属性可以使用语法$ {propname}在配置文件中使用。所有系统属性都可用,包括使用-D语法设置的那些属性,由JVM自动提供的那些属性以及在$ CATALINA_BASE/conf/catalina.properties文件中配置的属性。
详细:
https://tomcat.apache.org/tomcat-3.3-doc/serverxml.html#substitution
非常感谢你。最后,我使用了这个'-Dapp.unloadDelay = 60000'格式。 – Jeff