Discussions

EJB programming & troubleshooting: How to accessing Websphere Managed Variables?

  1. Hi..

    I've defined a couple of websphere managed variables from my admin console. AdminConsole -> Environment -> Managed WebSphere Variables.

    But i'm not sure how to access these variables from my java code, for example from a servlet or bean.

    Any ideas??
    System.getProperty("var name") does not work and just returns null. Any advice would be appreciated.
    Thanx.
    -R
  2. WebSphere managed variables are defined at three different scopes: Cell, Node, and Server. I have seen only one example of accessing WebSphere variables from a Servlet, and that was done through JMX, accessing WebSphere management classes. It was not a perfect solution; symbolic references in variables were not automatically substituted, for one thing. There are variables.xml files in the $WAS_HOME/config directory under the cell_name, node_name, and server name directories. It is probably not a good idea (security, complexity) but you may be able to write something to read those files to find the variable value you need.

    Bill Lasley
    Versant Corp.
    http://www.versant.com