File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Location of properties jar in an EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Location of properties jar in an EAR" Watch "Location of properties jar in an EAR" New topic

Location of properties jar in an EAR

Vinod Kumar

Joined: Jan 27, 2004
Posts: 3

I have set of property files, i placed all these property files into an jar and placed the jar in WEB-INF/lib directory. ResourceBundle is not able to locate the property file placed under this jar.

I tried putting the properties jar under EAR directly and added an manifest entry for both EJB jar and war. Still it is not working

Am i placing the properties jar in correct location? If no, can some one please tell me where i put this properties jar.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33119

I've always seen the property files loose. Are you allowed to put them in a jar and have the server find them?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
I would normally recommend including the properties files in the EAR file unless you need to change a file and don't want the hassle of rebuilding and redeploying the EAR. This could apply to a logger or configuration file. (Having said that, it may be possible to deploy an exploded directory - as you can with WebLogic Server - in which case you can edit the properties file in situ.)

There are several ways of achieving this. One way is place your JAR file containing the properties files anywhere in the EAR (say the root) and refer to it in the Manifest Class-Path of the J2EE modules that need access.

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
I agree. Here's the link:
subject: Location of properties jar in an EAR
It's not a secret anymore!