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, " 10.227.16.72: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(); Using ENC JNDI to access EJBs IF we want to use ENC JNDI then the , in the lookup method the name of the JNDI passed is prefixed with java:comp/env/ so, if we wish to use ENC JNDI and access ejb Sidd The JNDI name will look like java:comp/env/ejb/Fibo. It is a good practice to use ENC JNDI, since it seperates configuration from