John McKaine wrote:
Hello everyone.

The problem is fairly simple, but I just do not know what was happening.

On Tomcat server I have  virtual host and my application like this
(server.xml):

    <Engine Name="Catalina" defaultHost="www.workinua.com.ua">

      <Host Name="www.mysite.com" appBase="webapps" autoDeploy="false">
            <Alias> Workinua.com.ua </ Alias>
            <Context Path="" docBase="MyApp" debug="0" />
      </ Host>
</ Engine>


  After starting the server Tomcat, the context of my application is
initialized twice, I see it on logs.
At the forums encountered such a problem - advise to put autoDeploy =
"false", but it did not help.
I have tried all cases, but never got only one context initialized.
I would appreciate any ideas.

Hi, "John".

If your application is already deployed under (tomcat_dir)/webapps/MyApp, then just rewrite the section above like this :

<Host Name="www.mysite.com" appBase="webapps" autoDeploy="false">
  <Alias>Workinua.com.ua</Alias>
</Host>

and restart Tomcat.

Tomcat automatically finds your application under ../webapps, so it is not necessary (and even counter-productive) to indicate it a second time in a <Context> element. That /is/ what causes the double deployment.

In general, it is not advised anymore, in recent versions of Tomcat, to put Context elements in server.xml. One of the main reasons is that it does not allow you to deploy/undeploy applications without restarting the whole Tomcat.

Also, here are some more details :
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to