Bug 14624 - Error when reading some xls file
Summary: Error when reading some xls file
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5.1
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-17 09:07 UTC by Michele Franceschi
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
file excel (XP) with password protection (28.50 KB, application/octet-stream)
2002-11-18 14:31 UTC, Michele Franceschi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michele Franceschi 2002-11-17 09:07:08 UTC
CODE:
public class XSLExample {

  public XSLExample() {
  }

  public static void main(String[] args) throws IOException {
    POIFSFileSystem fs =  new POIFSFileSystem(new FileInputStream("sqm.xls"));
    HSSFWorkbook wb = new HSSFWorkbook(fs);

    System.out.println("Tot Sheet: " + wb.getNumberOfSheets());
    for (int i=0; i < wb.getNumberOfSheets(); i++) {
      System.out.println(wb.getSheetName(i));
    }
  }
}

ERROR:
java.lang.reflect.InvocationTargetException: 
java.lang.IllegalArgumentException: Illegal length
	at org.apache.poi.util.StringUtil.getFromUnicodeHigh
(StringUtil.java:115)
	at org.apache.poi.hssf.record.FontRecord.fillFields
(FontRecord.java:172)
	at org.apache.poi.hssf.record.Record.fillFields(Record.java:143)
	at org.apache.poi.hssf.record.Record.<init>(Record.java:105)
	at org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:125)
	at java.lang.reflect.Constructor.newInstance(Native Method)
	at org.apache.poi.hssf.record.RecordFactory.createRecord
(RecordFactory.java:254)
	at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:192)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:181)
	at innesto.XSLExample.main(XSLExample.java:24)
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record 
instance, the following exception occured: null
	at org.apache.poi.hssf.record.RecordFactory.createRecord
(RecordFactory.java:267)
	at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:192)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:181)
	at innesto.XSLExample.main(XSLExample.java:24)
Exception in thread "main"
Comment 1 Michele Franceschi 2002-11-18 14:31:06 UTC
Created attachment 3876 [details]
file excel (XP) with  password protection
Comment 2 Andy Oliver 2002-11-18 16:36:26 UTC
http://jakarta.apache.org/poi/faq.html#faq-5