Placing properties files on EAR, instead of WAR file

I have some config properties, e.g. log4j.properties (and other app config files) and I would like to place the on the EAR level, instead of WAR level? Any ideas how to do so on Websphere 6?

On WAR level, I can simply then under WEB-INF/classes.

I tried to put those properties files on the EAR root level and then add the Class-Path: log4j.properties xxxx

But, seems the WAR application (war and log4j.jar) can't read those properties..
mscprojhkAsked:
Who is Participating?
 
valipotorConnect With a Mentor Commented:
From:
http://www.ibm.com/developerworks/websphere/library/techarticles/0112_deboer/deboer.html

Yes, property files can be made part of the EAR file. This is equivalent to putting utility classes or a utility JAR file in the EAR file. Here are the basic steps:

   1. Add the property files to the EAR file as a JAR file or within a directory.
   2. Update the manifest file of the module that needs access to the property file to contain the run-time relative path to the folder or JAR(WAR) file within the EAR file. Doing this will add the property file to the classpath of that module.
   3. Use Class.getResourceAsStream() from the module to load the properties file from its classpath.

Hope this helps you,

valipotor
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.