private HelloWorldRemote lookupNewSessionBean() {
try {
Context c = new InitialContext();
Properties properties = new Properties();
properties.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs",
"org.jboss.naming rg.jnp.interfaces");
properties.put("java.naming.provider.url", "jnp://localhost:1099");
Context ctx = new InitialContext(properties);
Session.HelloWorldRemote ans=(Session.NewSessionRemote) ctx.lookup(
"HelloWorld/HelloWorldBean/remote");
return ans;
}
catch(NamingException ne) {
// do something
}
}