• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Persistent values in Tomcat 7  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to develop and deploy a WAR application for Tomcat 7. The application needs to talk to a server. I have configured this by having default server host and port as properties in the META-INF/context.xml file, which I access from the application without any problems.

Multiple people will be deploying this WAR and I would like to have an easy way for them to replace the values in the META-INF/context.xml file and preferably not having to redo this each time the application is redeployed. From what I understood you can overwrite the values with the values in the conf/Catalina/Localhost/<appname>.xml file. But here all my problems started.

First I tried to add the copyXML="true" to the Host in the conf/server.xml and the context.xml was copied as expected, then I changed the values, and the application restarted with the new values, so far so good. But when I redeployed (by overwriting the WAR file in the webapps directory) the context.xml from the newly deployed WAR file had overwritten the modified one in conf/Catalina/Localhost.

Next I removed the copyXML="true" (thinking that strictly I didn't need it now I had the file copied), but after a redeploy Tomcat deleted the file in conf/Catalina/Localhost, and even worse, when the copyXML is not set, it seems that the application is ignoring the values in the conf/Catalina/Localhost/<appname>.xml completely.

Anyone know what I am doing wrong?
(I'm running Tomcat 7.0.16 on an JDK 1.6.0_22-b04)

The content of the context.xml:

Mads Jurik
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem was an override="true" had been lost in the process somewhere.
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!