aspose file tools*
The moose likes Websphere and the fly likes Configure properties folder in websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Configure properties folder in websphere" Watch "Configure properties folder in websphere" New topic
Author

Configure properties folder in websphere

Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
For the application I am working on, I am trying to externalize properties into a property file (like jdbc url's)

I have created a folder C:\webdata\myApp\properties which has log4j.properties and jdbc.properties.

I am using jdbc.properties file in spring applicationContext.xml file.

In WAS (Application servers > server1 > Process Definition > Java Virtual Machine) , I have configured classpath to include this folder.

But when I start my server, Spring is unable to find the jdbc.properties file. Also, I see following error, which is making me think that websphere is not able to find log4j.properties and jdbc.properties file. Am I missing anything here which i need to configure in websphere?



Thanks for all the help.
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
Here is what I would suggest:

1. JDBC should be configured directly in WebSphere. (JDBC Provider, Data Source, J2C Authentication etc). To be able to use it with SPRING you can keep the DataSource JNDI name in web configuration xml file. Use pre-defined WAS variables (or create new if your driver is not listed) to point to specific jars etc. This way the core JDBC configuration (URL, user/password) is not lying outside in some property file and you will be able to take advantage of connection pools etc.

You may want to check following tech article at IBM's website:
http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html

2. For other properties you can either declare system property using -D option in JVM property of the server OR you can keep the property file under WEB-INF and load it as a resource bundle.

3. Please check following link for configuration of log4j, jakarta commons logging and spring:
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14045904
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configure properties folder in websphere