Hi, I am facing a problem while reading a excel file. Following is the error trace of the error: java.lang.NullPointerException at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet (HSSFSheet.java:171) at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:134) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:154) Following is the code which is producing the error- String JeffCegalisReportPath = "/home/ms210101/meenaxi/engchangecontrol.xls"; java.io.File jeffsFile = new java.io.File(JeffCegalisReportPath); FileInputStream fis = new FileInputStream(jeffsFile); fs = new POIFSFileSystem(fis); workbook = new HSSFWorkbook(fs); Workbook is not getting intialized. Error is coming at line in red, because fs has a value. If I print following- if(fs !=null) System.out.println("POIFSFileSystem "+fs.getShortDescription()); It prints POIFSFileSystem POIFS FileSystem. I would be grateful, if you reply to it. Thanks in advance
Created attachment 14948 [details] The excel file which needs to be read
Works. Test added in TestBugs to prove.