• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persistent values in Tomcat 7

 
Mads Jurik
Greenhorn
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:


TIA/Cheers,
Mads
 
Mads Jurik
Greenhorn
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic