• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Putting properties files in the root of the .ear?

 
Peter Storch
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
we first had our properties packaged in a .jar file within the .ear. The ejb and war modules then referenced this .jar file in the Class-Path entry in the manifest.mf file. It worked so far.
During deployment we found that sometimes it's necessary to adjust a properties file due to a change in the environemnt. It was quite messy to unpack the .jar file, edit the .properties file and repackage again. And we didn't want to perform a whole redeployment.
Then we came up with the idea to have the .properties directly in the root of the .ear. This works in WebSphere 4.0.x but I don't know if this is a good approach (according to the J2EE spec).
Does someone know if this works generally? Are all files in the .ear root included in the classpath so they can be loaded by getResourceAsStream()?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
You definitely should keep the property files loose (in other words, not in a jar.) We keep ours under a directory (/config) under the root of the ear and set websphere's classpath to refer to it.
 
Peter Storch
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changing the WebSphere classpath is not appropriate for us. Because there are several applications deployed in this appserver with similar properties files (same name but different settings e.g. log4j.properties).
 
Frank Hefter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Storch:
During deployment we found that sometimes it's necessary to adjust a properties file due to a change in the environemnt. It was quite messy to unpack the .jar file, edit the .properties file and repackage again. And we didn't want to perform a whole redeployment.

We put such properties into database. Protected by a installer role.
Is that possible in your case?
Frank
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic