title: Web Services returning null and the client hangs
body: <pre><code>@GET
  @Path("/employee/{empId}")
  @Produces(MediaType.APPLICATION_JSON)
  public EmployeeBean retriveEmployee(@PathParam("empId") String empId) {
      Connection conn = null;
  
      int status = 503;
      EmployeeBean eBeanResponce = null;//new EmployeeBean();
      List&lt;EmployeeBean&gt; empBeansFetched = null;
      String msg = null;
  
      try {
          int id = Integer.parseInt(empId);
          String sql = "select * from user where(userId = ?)";
          conn = DataSource.getInstance().getConnection();
  
          QueryRunner qRun = new QueryRunner();
          ResultSetHandler&lt;List&lt;EmployeeBean&gt;&gt; rsh = new BeanListHandler&lt;EmployeeBean&gt;(
                  EmployeeBean.class);
  
          empBeansFetched = qRun.query(conn, sql, rsh,id);
  
      } catch (NumberFormatException nfe) {
          msg = "Employee ID must be numeric received " + empId ;
  
      } catch (SQLException | IOException | PropertyVetoException e) {
          loger.error(e.getMessage());
          e.printStackTrace();
      } finally {
          if (empBeansFetched != null) {
  
              if (empBeansFetched.size() &gt; 1){
                  msg = "More than one row per empId";
                  loger.error(msg);
                  status=300;
                  if(loger.isDebugEnabled()){
                      Iterator&lt;EmployeeBean&gt; itr = empBeansFetched.iterator();
                      while(itr.hasNext()){
                          EmployeeBean e = itr.next();
                          System.out.println(e.getUserId());
  
                      }
                  }
              }
              else if(empBeansFetched.size() == 0){
                  msg = "No Such Employee "+ empId;
                  loger.error(msg);
                  status = 404;
              }
              else {
                  status = 201;
                  msg = "Sucess";
                  eBeanResponce = empBeansFetched.get(0);
              }
          } else {
              loger.error("Retrived NULL from DB");
          }
          closeConnection(conn);
      }
      System.out.println(status + " STATUS");
      Response.status(status).entity(msg).build();
      return eBeanResponce;
  }
  </code></pre>
  
  <p>// THIS is a code snippet of a web service.
  // If the if the DB query fails to fetch a row, the employee been would be null.
  // If I return the employee bean object which is null , I couldnt see the call getting completed. It just waits at the client side. I have tested using poster plugin.</p>