custom properties

I am using websphere app server 5.1 Have set some custom properties under

Servers > Application Servers > server > Custom Properties > property_name

e.g

HOST

USER_ID and PASSWD

Am trying to access these custom properties as follows

javax.naming.Context ic;

try

{

ic =new javax.naming.InitialContext();

javax.naming.Context ctx = (javax.naming.Context) ic.lookup("java:comp/env");

String variablename = (String) ctx.lookup("HOST");

System.out.println("variablename =====>" + variablename);

}catch (NamingException e)

{

// TODO Auto-generated catch block

e.printStackTrace();

}

But fail to retrive it since I get an exception saying

[code]

[9/8/06 16:50:28:847 EDT] 6a3eaef3 SystemErrR javax.naming.NameNotFoundException: Name "HOST" not found in context "java:comp/env".

[code]

Please advise.

[1257 byte] By [claudMa] at [2007-10-3 4:34:02]
# 1
You put some things in place A. Then you went to place B to look for those things. Naturally they aren't there.If you want to get a system property then System.getProperty() is the method to use.
DrClapa at 2007-7-14 22:37:39 > top of Java-index,Java Essentials,Java Programming...