aspose file tools*
The moose likes Servlets and the fly likes Using Application Property files in an EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Using Application Property files in an EAR

Obi Kenobi
Greenhorn

Joined: Nov 02, 2005
Posts: 2
In my deployment set-up, I want to keep the application level

property files outside of the EAR file, so that if we ever need to

modify the contents of these files, we won't have to re-deploy the EAR

file.

There are two ways (that I know) to do this. One is hardcode the

location of the property file on the server, but that bring up the

issue of having J2EE components accessing resources on the server , not
to mention a bunch of other issues if we have a clustered setup. The

2nd option is using a URL provider. I'm trying to set it up as per the

WAS documentation but get a wierd error.

http://www-128.ibm.com/developerworks/websphere/library/techarticles/...

The error I get is ..

Context: mhubDevCell2/nodes/sun522mhub-devn2_1/servers/server1, name:
url/PhoenixProperties: First component in name PhoenixProperties not
found.

where "url/PhoenixProperties" is the JNDI name and "PhoenixProperties"

is the URL (resource) on the WAS instance.

Was wondering if anyone here has received this error and fixed it OR if
anyone here has a more graceful way to configure & deploy application
level property files
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

Why is this repeated here:

http://www.coderanch.com/t/77232/Websphere/Application-Property-files-WebSphere


My Blog: Down Home Country Coding with Scott Selikoff
Rajesh Agarwal
Ranch Hand

Joined: Aug 01, 2005
Posts: 79
The best way to do this is to keep the file external to the ear file. Then
specify the path of the path in the -D parameter for java. In case you are using weblogic, you can specify -DKey=value where the java is started. Then in your code you could read the value of this key , load the file and parse it. Let me know if this solves your purpose
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
Master Kenobi...

First, please refrain from cross posting. Second, regardless of how strong you are in the ways of the force, I doubt your real name is Obi Kenobi. Please change it to adhere to the Java Ranck naming policy.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Application Property files in an EAR
 
Similar Threads
Simple tutorials for websphere
Property file in EAR
Websphere Studio 5.1.1 and "headless Ant"
Configuration of WAS6.0.1 JMS provider!
Application Property files in WebSphere