NotOLE2FileException: Invalid header signature; read 0x0000000000000000, expected 0xE11AB1A1E011CFD0 - file appears not to be a valid OLE2 document
<pre><code>try {
        File file = new File("file4.xls");
        if (!file.exists()) file.createNewFile();
        FileInputStream fis = new FileInputStream(file);
        POIFSFileSystem fileSystem = new POIFSFileSystem(fis);
        //   FileInputStream fis = new FileInputStream(file);
        HSSFWorkbook workbook = new HSSFWorkbook(fileSystem);
        //Sheet sheet = workbook.createSheet("sheet0");
        Sheet sheet = workbook.getSheet("sheet1");
        sheet.createRow(0).createCell(0).setCellValue("HelloWorld");
        Cell cell = sheet.createRow(1).createCell(0);
        cell.setCellValue("Value_1_1");
        fis.close();
        FileOutputStream fos = new FileOutputStream(file);
        workbook.write(fos);
        workbook.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
</code></pre>

<p>I am trying to create simple excel file using java. I am getting above mentioned error.</p>