You can use localhost as you're doing
with your weblogic stuff but better to use the configurable hostname:
jboss.bind.address
try
{
properties = new Properties();
properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
properties = new Properties();
properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.provider.url", System.getProperty("jboss.bind.address") +
":1099");
properties.put("java.naming.factory.url.pkgs",
"org.jboss.naming");
...
-----Original Message-----
From: Bret Kumler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 1:51 PM
To: Jboss
Subject: [JBoss-user] JNDI questionI was wonder, with the default installation of JBOSS, what is the jndi factory lookup for a datasource, the url, username and the password.E.G. for Weblogic:private Context getInitialContext(){Properties properties = null;
Context ctx =null;String weblogic_url="t3://localhost:7001";String weblogic_jndi_factory_name="weblogic.jndi.WLInitialContextFactory";String user="system";String pass="password";
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, weblogic_jndi_factory_name);
properties.put(Context.PROVIDER_URL, weblogic_url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, pass == null ? "" : pass);
}
ctx= new InitialContext(properties);
}
catch (javax.naming.NamingException e) {
logger.error("Unable to connect to WebLogic server at " + weblogic_url);
}
return ctx;
}Thanks