Bug 34775 - java.lang.NullPointerException at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet
Summary: java.lang.NullPointerException at org.apache.poi.hssf.usermodel.HSSFSheet.set...
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5.1
Hardware: Other Linux
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2005-05-06 12:17 UTC by Meenaxi
Modified: 2014-11-27 08:04 UTC (History)
1 user (show)

The excel file which needs to be read (90.00 KB, application/vnd.ms-excel)
2005-05-06 12:21 UTC, Meenaxi

Note You need to log in before you can comment on or make changes to this bug.
Description Meenaxi 2005-05-06 12:17:31 UTC

I am facing a problem while reading a excel file. Following is the error trace 
of the error:

        at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet
        at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:134)   
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>

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
Comment 1 Meenaxi 2005-05-06 12:21:42 UTC
Created attachment 14948 [details]
The excel file which needs to be read
Comment 2 Avik Sengupta 2005-05-19 17:13:13 UTC
Works. Test added in TestBugs to prove.