Someone have already seen this error ?
I get it just when I create my HSSFWorkbook
try {
LOGGER.info("Open Excel file: " + filename);
InputStream inputStream = new FileInputStream(filename);
Workbook wb = new HSSFWorkbook(inputStream);
Sheet sheet = wb.getSheetAt(0);
/* save excel */
FileOutputStream fileOut = new FileOutputStream(filenameOutput);
wb.write(fileOut);
fileOut.close();
wb.close();
inputStream.close();
} catch (IOException e1) {
LOGGER.log(Level.SEVERE, e1.getMessage(), e1);
}
error is on new HSSFWorkbook(inputstream)
Exception in thread "main" java.lang.RuntimeException: Unexpected missing row when some rows already present
at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet(HSSFSheet.java:212)
at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:137)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:338)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:289)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:224)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:382)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:364)
Any idea ?
I have seen this question on http://apache-poi.1045710.n5.nabble.com/Unexpected-missing-row-when-some-rows-already-present-td5527417.html but they don't give good answer
I use POI 3.12
UPDATE : My excel contain 53 rows and hundreds columns so he is not empty. The excel was generated with Buisness Object and some people have the very same issues with no solution.
Source code of HSSFSheet is here