-
1. Re: JNDI Problem when using client to JBoss
bhupendra.yaduvenshi May 25, 2006 6:12 AM (in response to fyness)In clude the jnpclient.jar
Bhupendra
bhupendra.yaduvenshi@gmail.com -
2. Re: JNDI Problem when using client to JBoss
chvnkishore Jun 27, 2006 5:33 AM (in response to fyness)Try this code it is not giving any err.
//to work this prog fine set classpath to "jbossall-client.jar;."
import javax.naming.*;
import java.util.*;
public class HelloWorld
{
public static void main(String[] args) throws Exception
{
Hashtable properties = new Hashtable();
//Jboss server properties.
properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
properties.put("java.naming.provider.url", "jnp://localhost:1099");
//Get the InitialContext.
Context ic = new InitialContext(properties);
System.out.println(ic);
ic.bind("AP","AP");
ic.bind("AP.Hyd","Hyd");
System.out.println(ic.lookup("AP"));
System.out.println(ic.lookup("AP.Hyd"));
}
}