I found a strange phenomenon of parse excel by poi. See code
goods.subtitle = row.getCell(headerNameIndexMap.get(\"subtitle\")).getStringCellValue();
As per the Apache POI JavaDocs, Row.getCell(int) may return Null. A null cell is one that has no value and no styling, and hence is not recorded in the file
Your code will therefore fail for empty cells, and for blank cells (previously held a value but no longer), and for numeric cells. So, frankly, most cases...
You should probably change your code to more like this:
DataFormatter formatter = new DataFormatter();
Cell cell = row.getCell(headerNameIndexMap.get("subtitle"), Row. RETURN_BLANK_AS_NULL);
if (cell == null) {
// No value here, handle
} else {
String subtitle = formatter.formatCellValue(cell);
}
That will handle empty cells, null cells, and will give you a string for formatted numeric cells