Properties pro = new Properties();
pro.put(Context.INITIAL_CONTEXT_FACTORY , "org.jnp.interfaces.NamingContextFactory");
pro.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
pro.put(Context.PROVIDER_URL, "jnp://localhost:1099");
try {
Context c = new InitialContext(pro);
IHello ih = (IHello) c.lookup("HelloImpl/remote");
ih.sayHello();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
pro.put(Context.INITIAL_CONTEXT_FACTORY , "org.jnp.interfaces.NamingContextFactory");
pro.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
pro.put(Context.PROVIDER_URL, "jnp://localhost:1099");
try {
Context c = new InitialContext(pro);
IHello ih = (IHello) c.lookup("HelloImpl/remote");
ih.sayHello();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}