tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Tomcat load context twise
Date Mon, 08 Feb 2010 22:12:54 GMT
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message