From tracing the code, it seems that a FontRecord is created with byte 14 > 0 which in turn causes field_10_font_name_len > 0 causing unicode decoding code to be invoked which produces the exception itself. I've followed the codepath and the data array is filled directly from the inputstream, retrieving a +ve 124 for data[14]. Caused by: java.lang.IllegalArgumentException: Illegal length at org.apache.poi.util.StringUtil.getFromUnicodeLE(StringUtil.java:78) at org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:146) at org.apache.poi.hssf.record.Record.fillFields(Record.java:91) at org.apache.poi.hssf.record.Record.<init>(Record.java:55) at org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:88) ... 25 more The exception is thrown in getFromUnicodeLE but i havent encountered that method usually being called to begin with. The font used itself is Arial so i'm not sure why its causing a problem. The value for data[14]=124 The value for data[15]=109 Also when the getFromUnicodeLE function is called, the length of the byte array titled string is 26 , the offset passed is 16 and the len paramater is 124. Printing out the function header getFromUnicodeLE(final byte[] string,final int offset,final int len) and I get getFromUnicodeLE([B@1f436f5,16,124) Also I got the same problem with 2.0 FINAL and the HEAD version I checked out from CVS
Can you upload a excel file causing the issue, or recheck against the latest svn code. Jason
*** This bug has been marked as a duplicate of 39190 ***