Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting autoDeploy and deployOnStartup will cause app be deployed twice on startup?

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

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.

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.

What's your opinion?

like image 786
khotyn Avatar asked Feb 23 '11 05:02

khotyn


1 Answers

Yes it does.

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

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

like image 107
sodarfish Avatar answered Oct 12 '22 16:10

sodarfish