You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Smillie <Pe...@nsc.net.au> on 2011/12/07 03:23:17 UTC

Tomcat 5.5 - Context for "MyApp" in MyApp/META-INF/context.xml is always over-writing conf/[enginename]/[hostname]/MyApp.xml

According to the Tomcat 5.5 documentation page "tomcat-docs/config/context.html#Introduction" when Tomcat is trying to decide on the context for a Web application:

Only if a context file does not exist for the application in the $CATALINA_HOME/conf/[enginename]/[hostname]/; in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as a WAR then /META-INF/context.xml will be copied to $CATALINA_HOME/conf/[enginename]/[hostname]/ and renamed to match the application's context path. Once this file exists, it will not be replaced if a new WAR with a newer /META-INF/context.xml is placed in the host's appBase.

My experience with Tomcat 5.5 is that the META-INF/context.xml file in the MyApp.war file is always overwriting $CATALINA_HOME/conf/[enginename]/[hostname]/MyApp.xml. Thus I always lose my site specific context customisation of Resources and the like.

Previously I have used Tomcat 5.0 and in that case the above Tomcat documentation statement held true, i.e. after an application's WAR was installed for the first time I could then customise the context file in directory $CATALINA_HOME/conf/[enginename]/[hostname]/ and it would not be overwritten.

Has anyone else had the same experience ? Can anyone explain how to change the behaviour of Tomcat 5.5.

Regards
Peter Smillie

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

RE: Tomcat 5.5 - Context for "MyApp" in MyApp/META-INF/context.xml is always over-writing conf/[enginename]/[hostname]/MyApp.xml

Posted by Peter Smillie <Pe...@nsc.net.au>.
All,

My experience was with Tomcat versions 5.5.33 and 5.5.34.

Regards
Peter Smillie

-----Original Message-----
From: Daniel Mikusa [mailto:dmikusa@vmware.com] 
Sent: Thursday, 8 December 2011 0:33
To: Tomcat Users List
Subject: Re: Tomcat 5.5 - Context for "MyApp" in MyApp/META-INF/context.xml is always over-writing conf/[enginename]/[hostname]/MyApp.xml

On Tue, 2011-12-06 at 18:23 -0800, Peter Smillie wrote:
> According to the Tomcat 5.5 documentation page "tomcat-docs/config/context.html#Introduction" when Tomcat is trying to decide on the context for a Web application:
> 
> Only if a context file does not exist for the application in the $CATALINA_HOME/conf/[enginename]/[hostname]/; in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as a WAR then /META-INF/context.xml will be copied to $CATALINA_HOME/conf/[enginename]/[hostname]/ and renamed to match the application's context path. Once this file exists, it will not be replaced if a new WAR with a newer /META-INF/context.xml is placed in the host's appBase.
> 
> My experience with Tomcat 5.5 is that the META-INF/context.xml file in the MyApp.war file is always overwriting $CATALINA_HOME/conf/[enginename]/[hostname]/MyApp.xml. Thus I always lose my site specific context customisation of Resources and the like.
> 
> Previously I have used Tomcat 5.0 and in that case the above Tomcat documentation statement held true, i.e. after an application's WAR was installed for the first time I could then customise the context file in directory $CATALINA_HOME/conf/[enginename]/[hostname]/ and it would not be overwritten.
> 
> Has anyone else had the same experience ? Can anyone explain how to change the behaviour of Tomcat 5.5.
> 
> Regards
> Peter Smillie
> 
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________

Peter,

What is the exact version of Tomcat 5.5 that you are using?

Dan



______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Re: Tomcat 5.5 - Context for "MyApp" in MyApp/META-INF/context.xml is always over-writing conf/[enginename]/[hostname]/MyApp.xml

Posted by Daniel Mikusa <dm...@vmware.com>.
On Tue, 2011-12-06 at 18:23 -0800, Peter Smillie wrote:
> According to the Tomcat 5.5 documentation page "tomcat-docs/config/context.html#Introduction" when Tomcat is trying to decide on the context for a Web application:
> 
> Only if a context file does not exist for the application in the $CATALINA_HOME/conf/[enginename]/[hostname]/; in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as a WAR then /META-INF/context.xml will be copied to $CATALINA_HOME/conf/[enginename]/[hostname]/ and renamed to match the application's context path. Once this file exists, it will not be replaced if a new WAR with a newer /META-INF/context.xml is placed in the host's appBase.
> 
> My experience with Tomcat 5.5 is that the META-INF/context.xml file in the MyApp.war file is always overwriting $CATALINA_HOME/conf/[enginename]/[hostname]/MyApp.xml. Thus I always lose my site specific context customisation of Resources and the like.
> 
> Previously I have used Tomcat 5.0 and in that case the above Tomcat documentation statement held true, i.e. after an application's WAR was installed for the first time I could then customise the context file in directory $CATALINA_HOME/conf/[enginename]/[hostname]/ and it would not be overwritten.
> 
> Has anyone else had the same experience ? Can anyone explain how to change the behaviour of Tomcat 5.5.
> 
> Regards
> Peter Smillie
> 
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________

Peter,

What is the exact version of Tomcat 5.5 that you are using?

Dan