referencing application specific property files in ear from
katazan Mar 18, 2003 1:17 PMI've been struggling with this issue for months, and have put-it-off and found temporary workarounds to facillitate development progress. It has come time to deploy my application into production, however, and I am faced with having to solve this issue before I can launch.
I'm using ant to package several different application files, each of which uses some framework classes I've written myself (best-practices pattern implementations for handling persistence and property mangagement). The framework classes that I've written rely on a consistently named property file that is loaded from the classpath. Here's a scenario:
reportingapp.ear
-app.properties**
-sql.properties**
-reporting.war
-reportingejb.jar
-lib
-ejbclient.jar
-ejbutil.jar
-META-INF
-application.xml
** These property files have different contents for every application (data source, jndi lookup info for EJBs, factory settings, etc). They are not named differently, however. So, every other application ear file has the same names for the property files, but the files that are packaged with the respective ear files have application-specific content.
My ejbs are having trouble finding their configuration files for getting at SQL prepared statement strings, and Datasource jndi information. I have a requirement to run all of the ears in the same JBoss instance. The classloader for a given ear should load the ear-specific properties files that are packaged with it FIRST, thus ignoring any other property files with the same name that are associated with other ear application files.
I've tried referencing these property files via the ant manifest option as follows, with the following results:
The manifest file ends-up with two linebreaks at the end of the file that I think might be hosing the references-up, but I can't say for sure. I have another jar file that requires several classpath entries in the manifest (theoretically), but the MANIFEST.MF file's entry for that classpath has had line-breaks inserted into it around 70 characters.
Is there a trivial method for accomplishing what I'm attempting that I've overlooked, or havn't yet stumbled upon? Please, oh please share.
Thanks,
John C. Dale
CEO
Down in the Desert, Inc.