Placing properties files on EAR, instead of WAR file

M

mullin

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..
 
L

Lew

mullin said:
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?

6.0 or 6.1?
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

Class-Path tells what directories outside the JAR to search. You specified a
file inside the JAR. You need to specify the location of that file, not the
file itself; the class loader mechanism then searches that (those) location(s)
for the resource at runtime.

I assume that you meant you "add[ed] the Class-Path" to the manifest, which
you didn't specify in your message but must have been so.

I'm not so familiar with EAR deployments, but common resources are usually
specified in resource descriptors like a "config.xml". Others wiser than I in
these matters might offer specific details, or you can look for "module
descriptors" or "deployment descriptors" or similar verbiage in your WebSphere
documentation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top