设置autoDeploy和deployOnStartup是否会导致应用在启动时被部署两次? [英] Setting autoDeploy and deployOnStartup will cause app be deployed twice on startup?

查看:781
本文介绍了设置autoDeploy和deployOnStartup是否会导致应用在启动时被部署两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Damonar Chetty撰写的《 Tomcat 6开发人员指南》,在主持人一章中他说:

I'm reading "Tomcat 6 Developer's Guide" written by Damonar Chetty, and in the host chapter he says:


同时设置两者设置为true将导致在启动时部署应用程序,然后在Tomcat启动并运行后再次部署。因此,请确保将其中至少一项设置为false,以避免重复部署同一Web应用程序。

Setting both to true will cause an application to be deployed at startup, and then again once Tomcat is up and running. As a result, ensure that you set at least one of these to false to avoid redundant deployment of the same web application.

我将autoDeploy,deployOnStartup和unpackWARs设置为true,然后将战争放入APPBASE文件夹并调试部署过程,但是tomcat只是根据主机的启动事件部署战争。在autoDeploy的定期事件中没有部署发生。我认为这是因为第一次部署后没有任何改变,而Demonar Chetty所说的话是不对的。

So, I set autoDeploy, deployOnStartup and unpackWARs to true, then put a war into the APPBASE folder and debug the deploy process, but tomcat just deploys the war in reponse to the host's start event. No deployment occurs in the periodic event of autoDeploy. I think this is because nothing ever changed after the first deployment, and what Demonar Chetty says is not right.

您有什么看法?

推荐答案

是的。

如果在 server.xml 中添加Conext元素,并设置 autoDeploy = true ,tomcat将进行两次部署。

If you add Conext element in server.xml, and set autoDeploy="true", tomcat will do deployment twice.

您只需设置 autoDeploy = false 或删除 server.xml 中的context元素。

you can just set autoDeploy="false" or remove the context element in server.xml.

这篇关于设置autoDeploy和deployOnStartup是否会导致应用在启动时被部署两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆