Changing J2EE App Configuration with out Rebuilding

G

gilgantic

I want to be able to make configuration changes in my J2EE applications
with out rebuilding and redeploying the application everytime. What
are some recommendations? On a previous project we put everything in a
XML document and parsed the document each time for connection, JNDI
URL, etc. instead of using .properties files like I am currently using.
 
P

Paul Ilechko

gilgantic said:
I want to be able to make configuration changes in my J2EE applications
with out rebuilding and redeploying the application everytime. What
are some recommendations? On a previous project we put everything in a
XML document and parsed the document each time for connection, JNDI
URL, etc. instead of using .properties files like I am currently using.
Can you be more specific ? J2EE already provides an infrastucture to
separate development from deployment issues, so what is that you can't
do ? You really shouldn't need to reinvent this stuff.
 
D

Dexthor

I think gilgantic is referring to the properties or other files that an
Application requires at run time, which are not included in the EAR. If
they are included, then the App build (EAR file) is specific to one
environment, be it DEV or QA.

How does J2EE Solve that need ? Build EAR once, and deploy to any
environment ?

We chose to set a Variable in the Server Environment, which hints the
App (if its looking for it) that the current environment is
{PROD|QA|DEV}. Accordingly, the EAR file loads its properties files as:
/ENV/file1.properties... And each EAR build will include files for
all environments in one place either within the EAR (selfcontained) or
outside in a predefined location.

I am interested to know how others do it.

-Dexthor.
 
R

Ray McVay

That's the way to do it. Set the distinguishing properties in the server
configuration.
 
C

cyrille.leclerc

Hi,

I recommand you to have a look at the Spring Framework's
PropertyPlaceHolderConfigurer idea. It is a very elegant way to manage
environement specific configuration.

More over, you should have a look at a recent article published on
ONjava site : "Advanced Configuration of the Spring MVC Framework". The
author proposes a smart way to deal with multi environment
configuration files without modifying the EAR.
He uses the hostname to find out the config params to use. I would
prefer to use an environment variable like
"deploymentEnvironment=[integration, preProduction, production]".

Hope this helps,

Cyrille

Resources :
"Advanced Configuration of the Spring MVC Framework" :
http://www.onjava.com/pub/a/onjava/2006/03/22/advanced-spring-configuration.html
 

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
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top