title: Unable to perform JNDI lookup using IBM WebSphere Application Server Liberty
body: <p>I am using IBM WebSphere Application Server Liberty to perform JNDI lookup.I am pretty sure about giving right about the location of resources in the project. However, when i run this I am getting a name not found error.</p>
  
  <p>Here is the code performing the lookup:</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
  {
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    try {
        FlightService flightService = (FlightService)new InitialContext().lookup("java:comp/Web1/FlightService!com.airline.FlightService");
    }
    catch(Exception ex){
        ex.printStackTrace();
    }
    if(flightService !=null){
        out.println(flightService.getAirplaneModel());
        out.println(flightService.getFrom());
        out.println(flightService.getTo());
  
    }
  }
  </code></pre>
  
  <p>Here is the server.xml:</p>
  
  <pre><code>&lt;server description="new server"&gt;
  
    &lt;!-- Enable features --&gt;
      &lt;featureManager&gt;
        &lt;feature&gt;webProfile-7.0&lt;/feature&gt;
        &lt;feature&gt;localConnector-1.0&lt;/feature&gt;
      &lt;/featureManager&gt;
  
    &lt;!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" --&gt;
    &lt;httpEndpoint httpPort="9090" httpsPort="9443" id="defaultHttpEndpoint"/&gt;
  
    &lt;!-- Automatically expand WAR files and EAR files --&gt;
    &lt;applicationManager autoExpand="true"/&gt;
  
  
    &lt;applicationMonitor updateTrigger="mbean"/&gt;
  
    &lt;webApplication id="Web1" location="Web1-0.0.1-SNAPSHOT.war" name="Web1"/&gt;
  &lt;/server&gt;
  </code></pre>
  
  <p>I am not sure , If i have to set any configuration related properties. Any help would be appreciated.</p>