title: Using InitialContext for lookups on Liberty
body: <p>I am working on migrating ear application from WebSphere 8.5 to WebSphere Liberty.</p>
  
  <p>There are 2 EJB Applications A and B deployed on different systems.</p>
  
  <p>In the code , whenever B has to talk with A, the steps were</p>
  
  <p>a) Create InitialContext  and pass the EJB URL of A</p>
  
  <pre><code>Hashtable&lt;String, String&gt; env = new Hashtable&lt;String, String&gt;();
  env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
  env.put(Context.PROVIDER_URL, url);
  InitialContext ic = new InitialContext(env)
  </code></pre>
  
  <p>b) Use this InitialContext to then do JNDI lookup</p>
  
  <p>To migrate this code to Liberty , I need to replace all JNDI lookups for EJB Interfaces with java namespace.</p>
  
  <p>The migration tool also suggests using default InitialContext and not passing the INITIAL_CONTEXT_FACTORY and PROVIDER_URL on Liberty</p>
  
  <pre><code>InitialContext  context = new InitialContext();
  </code></pre>
  
  <p>My question is how will this work in case of liberty for the above scenario where A and B are on remote systems ? 
  Don't we require the EJB Url to be provided?</p>
  
  <p>Another related question is whether this change is backward compatible with Websphere 8.5</p>