title: Initial Context property values for EJB lookup
body: <p>I am learning basics of EJB 3.0. I have managed to get a sample code up and running. Now I am doing a line by line analysis to have in-depth knowledge. But I am stuck at few lines where there is a lookup to find the required bean.</p>
  
  <p>Can anyone please explain me in simple language the meaning and the need of the following lines?
  </p>
  
  <pre><code>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.setProperty(Context.PROVIDER_URL, "localhost:1099");
  
  IniialContext context = null;
  SamleEjbRemote cl = null;
  try {
      context = new InitialContext(properties);
      cl = (SampleEjbRemote) context.lookup("SampleEjbBean/remote");
  } catch (NamingException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
  }
  </code></pre>
  
  <p><br>
  What is the exact meaning of each of the 'key' and 'value' that is used in properties?</p>
  
  <p>Rest of it is to put the 'properties' in the initial context instance. I have had a very vague idea of the above, but I want to clarify it very clearly. I would be glad if anyone could point me to any links or insights about the above lines.</p>
  
  <p>Thanks in advance.</p>