It happened to me the needing of retrieving via java, in a Websphere 5.1 server, a string variable defined at a “cell level”.
After some research, I found that the variable have to be defined in the following path (Websphere admin console): admin console -> environment -> naming -> name space bindings and then it can be retrieved by the following java code
String s = (new InitialContext()).lookup("thisNode/cell/legacyRoot/variablename");
What I thought the first time: define the variable in admin console -> environment -> manage websphere variables, is not working because the variables here defined, are only for administrative purpose and can’t be seen by the jvm.
Another way to make a variable available for all the applications is to define it directly on the jvm command line and then retrieve it by the System.getProperty(). But if you have more than one server, it’s too expensive to maintain, because you will have to define it for each server.