Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

Placing properties files on EAR, instead of WAR file

Thread view: 
mullin - 02 Aug 2007 12:31 GMT
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..
Lew - 02 Aug 2007 13:46 GMT
> 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.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.