gpt4 book ai didi

java - Tomcat 是否一遍又一遍地重新部署我的 Web 应用程序?

转载 作者:行者123 更新时间:2023-11-28 22:49:36 25 4
gpt4 key购买 nike

我的 Java Web 应用程序开始出现零星中断。仔细查看日志,我发现这种模式在一天内重复了数百次。

INFO: Undeploying context [/TheChosenOne]
INFO: Deploying web application archive /var/lib/tomcat/webapps/TheChosenOne.war
INFO: Deployment of web application archive /var/lib/tomcat/webapps/TheChosenOne.war has finished in 323 ms

据我所知,没有人(故意)对此负责。什么会导致这种情况发生?在没有人明确要求的情况下,是什么触发了这样的重新部署?这严格来说是 Tomcat 配置问题吗?还是代码本身会导致这种情况发生?

最佳答案

Tomcat can be configured to check on a regular basis if the files of your application have changed on disk, and redeploy the application if they did. As checking if files have changed is incredibly cpu and memory intensive it is recommend to disable the automatic web application redeployment feature, on production servers which is enabled by default.

修改它,使其类似于下面的代码段:

<host appbase="webapps" autodeploy="false" name="localhost" unpackwars="true" xmlnamespaceaware="false" xmlvalidation="false" />

有关自动部署的更多信息,请参阅 http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Common_Attributes

关于java - Tomcat 是否一遍又一遍地重新部署我的 Web 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44571015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com