In Tomcat 5, I would build a WAR file and place it on my test server. On this server there was a my-app.xml file in the CATALINA_HOME/conf/[EngineName]/[HostName] directory that pointed to my test database. Once I finished testing, I would send the WAR file to my clients IT department and they would put the file in the CATALINA_HOME/webapps directory. On their instance of Tomcat, they had a different my-app.xml file that pointed to the production database.
Recently we upgraded to Tomcat 6, when either of us copy the WAR file into the webapps directory, it deletes the my-app.xml file. After it is deleted, if I copy a backup of my-app.xml file into the CATALINA_HOME/conf/[EngineName]/[HostName] directory, Tomcat ignores it, even if I reload the webapp from Tomcat Manager.
I tried adding a context.xml file to the META-INF directory in the WAR file. When Tomcat was expanding the WAR file, it would overwrite the my-app.xml file with the context.xml file. If I then copied the backup of my-app.xml file back into the CATALINA_HOME/conf/[EngineName]/[HostName] directory, Tomcat deletes the WAR file and the expanded directory.
I can include the appropriate my-app.xml file inside the WAR file, but this means building two WAR files, one with the test my-app.xml and one with the production my-app.xml. I also can get it to work if I copy the WAR files or the my-app.xml backup files in a specific order into the correct directories. I am not fond of either of these solution for multiple reasons.
What am I doing wrong? Why does this not work in the new version? Do I need to change an option? Do I need to change my process? (NOTE: The client's IT department does not want to have to stop and start Tomcat to redeploy a new WAR file.)
Thanks!