title: When reading .xlsx file using POI I got an error "Zip File is closed"
body: <pre><code>public Sheet readExcel() throws Exception{
      //File fi=new File(new File(System.getProperty("user.dir"))+"\\src\\testdata2.xls");
      File fi=new File("C:\\Users\\admin\\workspace\\HMS\\src\\testdata\\testdata1.xlsx");
  
      Workbook wb = new XSSFWorkbook(fi);
      Sheet  Sheet = wb.getSheetAt(0);
  
      int rowCount = Sheet.getLastRowNum()-Sheet.getFirstRowNum();
  
      for (int i = 1; i &lt; rowCount+1; i++) {
          Row row = Sheet.getRow(i);
  
          if(row.getCell(0).toString().length()==0){
  
              System.out.println(row.getCell(1).toString()+"----"+ row.getCell(2).toString()+"----"+
  
              row.getCell(3).toString()+"----"+ row.getCell(4).toString());
          }
      }    
      return Sheet;   
  }
  </code></pre>
  
  <p>By running above code am getting error like this........</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalStateException: Zip File
    is closed
        at org.apache.poi.openxml4j.util.ZipFileZipEntrySource.getEntries(ZipFileZipEntrySource.java:45)
        at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:186)
        at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:684)
        at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:254)
        at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:201)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:294)
        at ExcelReader.readExcel(ExcelReader.java:16)
        at ExcelReader.main(ExcelReader.java:30)</p>
  </blockquote>
  
  <p>Can anyone help me tracing out what exactly is the problem.</p>
  
  <p>I Googled but couldn't get the solution!</p>