Invoking EJB deployed on a remote machine
Invoking EJB deployed on a remote machine In case we are calling remote ejb( ejb deployed on remote machines), The JNDI lookup might lookup like, Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.put(Context.PROVIDER_URL, "XX.XXX.XX.XX:1099"); env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); Context ctx = new InitialContext(env); If we are calling local ejb then we can simply create InitialContext without any parameters. Like, Context ctx = new InitialContext();