File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configure properties folder in websphere

 
Saritha Penumudi
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 446
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic