• Post Reply Bookmark Topic Watch Topic
  • New Topic

app server properties that are availabile to ear  RSS feed

 
Marilyn de Queiroz
Sheriff
Posts: 9079
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a need in our J2EE application to use soft-coded properties that are specific to the environment they are being run on (i.e. MYAPP_HOME, location where resulting files should be placed, etc).

Because they are specific to the environment rather than the application, they are not in the ear file, but must be available to the classes in the ear file.

How can we make those properties available to the ear running in the app server without including them in the ear file?
[ August 19, 2004: Message edited by: Marilyn de Queiroz ]
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EAR can easily access the file system so this isn't really a problem. The problem is to tell the EAR the path to that file. I typically manage that in one of two ways:

1) A config.properties file on the Server CLASSPATH or in a jar that is referenced in the Manifest of all EAR components. The properties file would tell the EAR about locations of various types of resources, therefore it is easy to configure between various environments.

2) A JVM property. Also flexible but quite a bit more painful to maintain than number 1.
 
Marilyn de Queiroz
Sheriff
Posts: 9079
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1 sounds like it might work well. Thanks, Chris. I'll try it out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!