This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB and other Java EE Technologies and the fly likes Changing properties file inside of an ear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Changing properties file inside of an ear" Watch "Changing properties file inside of an ear" New topic
Author

Changing properties file inside of an ear

Joshua Kay
Greenhorn

Joined: Jan 07, 2004
Posts: 7
Hi all-
We are deploying ear files for a project. The war inside of the ear contains a config.properties file which dictates most of the settings.
I build with a custom ant script on windows, and deploy via a samba directory to WebLogic 6 or 7 (depending on app) on a Solaris 9 platform.

Is there a good way to change the properties file, somehow - without rebuilding the ear with my ant script every time?
For example, the J2EE app talks with a C++ server on a given port (i.e. 14000) and depending on which server I deploy to, that port will be different.
I can rerun the script easy enough, I would just prefer not to.
Thanks
Josh
Joshua Kay
Greenhorn

Joined: Jan 07, 2004
Posts: 7
I can probably just deploy the ears exploded, since this is the development environment - any other thoughts?
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
IBM has a tool entittled earexpander the expands and collapses EARs. You cound expand. Edit. Collapse.
It comes with the 5.0 version for sure.
jaya jaya
Greenhorn

Joined: May 17, 2003
Posts: 8
You can change the properties file in runtime , by placing the properties file outside the ear in solaris...
Add this code in your run.bat of your AppServer
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -Dlfs.home=D:\lfshome
here D:\lfshome is the path where your property file lies.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Changing properties file inside of an ear