I have an existing web service built with Java 6, Tomcat 6, and Hibernate 3.2 that uses hibernate.cfg.xml for object mappings only, and webservice.beans.xml (used by wed.xml) for the datasource and other properties.
I'd like to reuse these files, if possible, for the configuration of the batch/cron files that will work on the same data.
One key feature is that there are properties files (db_config.properties) outside the webapps directory that contain the database login information (only username, password, and url), so that development, test, and production servers can be individually configured without having to modify the passwords each time a new set of code is deployed. Also, that file is locked on the test and production servers for security reasons.
I was able to get my standalone app to run using hardcoded values for the datasource (inserted into the hibernate.cfg.xml), but that is not acceptable for production. I'm hoping there is a reasonable way to read in the webservice.beans.xml file in a standalone application.
Any ideas?
|