你可以試試這個: 啓動命令行你的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