title: org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file
body: <p>My code is not working, it always shows the above mentioned exception.
  but I can always see the tmp file being generated.</p>
  
  <p>here is the code, can someone please suggest something:</p>
  
  <pre><code>FileInputStream fis =null;
          try{
          fis= new FileInputStream(new File("/home/amar/Desktop/new/abc.xls"));
  
          Workbook wb = new org.apache.poi.xssf.usermodel.XSSFWorkbook(fis);
                  int numOfSheets = wb.getNumberOfSheets();
  System.out.println("bhargo num of sheets is " + numOfSheets);
          for(int i=0; i&lt;numOfSheets; i++){
              org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(i);
              Iterator&lt;Row&gt; rowIterator = sheet.iterator();
              while (rowIterator.hasNext())
              {
                  Row row = rowIterator.next();
                  Iterator&lt;Cell&gt; cellIterator = row.cellIterator();
                  while (cellIterator.hasNext()) {
                      Cell cell = (Cell) cellIterator.next();
                      if (cell.getCellType() == cell.CELL_TYPE_STRING) {
                          System.out.println("bhargo cell value is " + cell.getStringCellValue().trim());
                      }
                  }
              }
              }
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      finally{
          System.out.println("bhargo, closing the stream");
      try {
          fis.close();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      }
  </code></pre>