tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
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="">
>       <Host Name="" appBase="webapps" autoDeploy="false">
>             <Alias> </ 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="" appBase="webapps" autoDeploy="false">

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 :

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message