wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Correct place for _editable_ app config files ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Correct place for _editable_ app config files ?" Watch "Correct place for _editable_ app config files ?" New topic
Author

Correct place for _editable_ app config files ?

Tolu A. Kumar
Greenhorn

Joined: Aug 17, 2007
Posts: 1
This seemingly simple question actually applies to any application server. The problem is, simply put, where should I put my _editable_ configuration files for best maintainability. That is, properties, or even some segments of Spring context files that contain runtime environment information. Is it

1) under WEB-INF in the jar => the jar is extracted under webapps
The files will then, of course, be overwritten by the next deployment
OR
2) deploy them separately in the tomcat-level conf directory
3) something else ?

Is there a "recommended" best practice on how to do runtime configs on modern app servers?

The case: After a year of running an app in production, I was deploying a new package on a Tomcat hosted by a third party. During that time, the service provider had changed the DB url and uid/pwd in the exploded webapp directory, without notifying anybody.

Spring developers habitually configure everything in the *context.xml files, including DB connection parameters, so that's what was edited in the webapps directory by the ISP. So, when I deployed the new app version, the valid DB connection params were overwritten by the configs that had been written according to the latest knowledge of the runtime environment. Fortunately, I had taken a backup of the webapps directory so I was able to trace and replicate the changes.

To sum it up, it seems a bit dodgy to me to assume that the ISP could directly edit the stuff in the exploded webapps directory... Did I get this all wrong, or do you see my point ? Of course, this has a lot to do with the ISP:s process of app maintenance, too...
 
jQuery in Action, 2nd edition
 
subject: Correct place for _editable_ app config files ?