Skip to content

Instantly share code, notes, and snippets.

@dblevins
Created June 22, 2009 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblevins/134229 to your computer and use it in GitHub Desktop.
Save dblevins/134229 to your computer and use it in GitHub Desktop.
Properties p = new Properties();
p.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
p.put("java.naming.provider.url", "http://127.0.0.1:8080/openejb/ejb");
// user and pass optional
p.put("java.naming.security.principal", "myuser");
p.put("java.naming.security.credentials", "mypass");
InitialContext ctx = new InitialContext(p);
MyBean myBean = (MyBean) ctx.lookup("MyBeanRemote");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment