java.lang.RuntimeException: Expected an EXTERNSHEET record but got (org.apache.poi.hs
Hi All,
I have developed a Core Java application for converting excel to csv files(in Eclipse galileo) using poi3.5beta2.jar. I'm able to covert excel to csv.
Note: The excel files i am processing are 97-2003 version files.
**************
Yesterday when i was executing a excel file, I got
"java.lang.RuntimeException: Expected an EXTERNSHEET record but got (org.apache.poi.hssf.record.SSTRecord)
at org.apache.poi.hssf.model.LinkTable.readExtSheetRe cord(LinkTable.java:188)
at org.apache.poi.hssf.model.LinkTable.<init>(LinkTab le.java:164)
at org.apache.poi.hssf.model.Workbook.createWorkbook( Workbook.java:250)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>( HSSFWorkbook.java:278)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>( HSSFWorkbook.java:201)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>( HSSFWorkbook.java:183)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.convertBySheetTypeMultipleTCS(ExcelToCsvConver ter.java:634)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.main(ExcelToCsvConverter.java:967)
30 Oct, 2009 4:17:54 PM com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter convertBySheetTypeMultipleTCS
SEVERE: Failed Converting to .csv format e : C:\Users\test\Desktop\CMBS INFO FILES\Mukund Mail Files\santosh files\lsOct09\AMRESCO1997C1_delinqReport0910.xls Count => 1
java.lang.NullPointerException
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.convertBySheetTypeMultipleTCS(ExcelToCsvConver ter.java:641)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.main(ExcelToCsvConverter.java:967)".
*****************
When i tried to debug, i found that
HSSFWorkbook wb = null;
POIFSFileSystem fs = null;
try
{
fs = new POIFSFileSystem(new FileInputStream(excelFile));
wb = new HSSFWorkbook(fs);
}
catch(Exception e)
{
e.printStackTrace();
}
wb in the try block was null and an exception was throw like Null pointer exception.
But when i opened the file and saved the file(without any changes) the size of excel file got reduced, and when i run my application the csv file was generated with out any error...
I have 100+ files which are giving this problems....
So i canot manually try to open and save...
Pls help me...Thanks in Adance....
java.lang.RuntimeException: Expected an EXTERNSHEET record but got (org.apache.poi.hs
Hi All,
I have developed a Core Java application for converting excel to csv files(in Eclipse galileo) using poi3.5beta2.jar. I'm able to covert excel to csv.
Note: The excel files i am processing are 97-2003 version files.
**************
Yesterday when i was executing a excel file, I got
"java.lang.RuntimeException: Expected an EXTERNSHEET record but got (org.apache.poi.hssf.record.SSTRecord)
at org.apache.poi.hssf.model.LinkTable.readExtSheetRe cord(LinkTable.java:188)
at org.apache.poi.hssf.model.LinkTable.<init>(LinkTab le.java:164)
at org.apache.poi.hssf.model.Workbook.createWorkbook( Workbook.java:250)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>( HSSFWorkbook.java:278)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>( HSSFWorkbook.java:201)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>( HSSFWorkbook.java:183)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.convertBySheetTypeMultipleTCS(ExcelToCsvConver ter.java:634)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.main(ExcelToCsvConverter.java:967)
30 Oct, 2009 4:17:54 PM com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter convertBySheetTypeMultipleTCS
SEVERE: Failed Converting to .csv format e : C:\Users\test\Desktop\CMBS INFO FILES\Mukund Mail Files\santosh files\lsOct09\AMRESCO1997C1_delinqReport0910.xls Count => 1
java.lang.NullPointerException
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.convertBySheetTypeMultipleTCS(ExcelToCsvConver ter.java:641)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.main(ExcelToCsvConverter.java:967)".
*****************
When i tried to debug, i found that
HSSFWorkbook wb = null;
POIFSFileSystem fs = null;
try
{
fs = new POIFSFileSystem(new FileInputStream(excelFile));
wb = new HSSFWorkbook(fs);
}
catch(Exception e)
{
e.printStackTrace();
}
wb in the try block was null and an exception was throw like Null pointer exception.
But when i opened the file and saved the file(without any changes) the size of excel file got reduced, and when i run my application the csv file was generated with out any error...
I have 100+ files which are giving this problems....
So i canot manually try to open and save...
Pls help me...Thanks in Adance....
Vamshi
org.apache.poi.poifs.filesystem.OfficeXmlFileExcep tion:
Hi All,
I have developed a Core Java application for converting excel to csv files(in Eclipse galileo) using poi3.5beta2.jar. I'm able to covert excel to csv.
Note: The excel files i am processing are 97-2003 version files.
**************
Yesterday when i was executing a excel file, I got
"
org.apache.poi.poifs.filesystem.OfficeXmlFileExcep tion: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
at org.apache.poi.poifs.storage.HeaderBlockReader.<in it>(HeaderBlockReader.java:111)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<i nit>(POIFSFileSystem.java:151)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.convertBySheetTypeMultipleTCS(ExcelToCsvConver ter.java:633)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.main(ExcelToCsvConverter.java:967)
30 Oct, 2009 4:37:32 PM com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter convertBySheetTypeMultipleTCS
SEVERE: Failed Converting to .csv format e : C:\cmbs\runscript\temp\santosh\santoshInput\lsOct0 9\BACM2001PB1_servicerReport0910.xls Count => 1
java.lang.NullPointerException
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.convertBySheetTypeMultipleTCS(ExcelToCsvConver ter.java:641)
at com.bloomberg.mtge.cmbs.roll.util.ExcelToCsvConver ter.main(ExcelToCsvConverter.java:967)
".
*****************
When i tried to debug, i found that
HSSFWorkbook wb = null;
POIFSFileSystem fs = null;
try
{
fs = new POIFSFileSystem(new FileInputStream(excelFile));
wb = new HSSFWorkbook(fs);
}
catch(Exception e)
{
e.printStackTrace();
}
wb in the try block was null and an exception was throw like Null pointer exception.
But when i opened the file and saved the file(without any changes) the size of excel file got reduced, and when i run my application the csv file was generated with out any error...
I have 100+ files which are giving this problems....
So i canot manually try to open and save...
Pls help me...Thanks in Adance....
Vamshi