This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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:
Joined: Jul 21, 2011
Problem was an override="true" had been lost in the process somewhere.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com