Reading Custom Properties maintained within WebSphere

Discussions

General J2EE: Reading Custom Properties maintained within WebSphere

  1. Hi, Because of JNDI lookup issue I have to specify the config info in a properties file. This will give new direction for config management outside Websphere as I would like to maintain all config through WebSphere only. My question is there any way within WebSphere to maintain key value pairs and retrieve them from the application. I noticed there is an option to maintain them using WebSphere console at Application servers > server1 > Custom Properties. But I am not sure how they can be read from the application. What I am looking forward from this forum is - How can we maintain the key value pair within Websphere and how to read them from the application. - Can we maintain key/value pairs as JNDI resources. Thanks in Advance, Gautham
  2. Gautham, The screen you're using there specifies custom properties that the server uses, not JVM system properties. In WAS 5.1 (6.x may be slightly different) go to Application Servers > server1 > Process Definition > Java Virtual Machine > Custom Properties. The properties you specify there get passed in as arguments to the JVM when WAS starts, ie "-Dproperty=value". Hence you'll need to restart WAS after setting those properties. As far as maintaining key/value pairs as JNDI resources, I've always thought that would be a great idea, but I don't think it's possible. In WAS you can supply URL's as JNDI resources though.
  3. Hi James, Thanks for the Reply. I was able to maitain key/value pair as name space variable in WAS6.1 Environment->Naming->Name Space Bindings->New-> String -> (Binding identifier is something unique) but Name in name space is used in the context lookup, whichi is similar to how we perform lookup for JNDI resources. Regards, Gautham
  4. Can you give me an example how it is used in the context lookup?