I wrote a following code to read xls file that is created by Japanese MS-Excel 2000. public class Test { public static void main ( String[] args ) throws IOException { if ( args.length != 1 ) { System.err.println ( "Usage: java Test xls_file" ); System.exit ( 0 ); } FileInputStream fi = new FileInputStream ( args[1] ); HSSFWorkbook wb = new HSSFWorkbook ( fi ); fi.close ( ); } } It's almost O.K. But, reading some xls file, HSSFWorkbook throws following exceptions. 1) Exception in thread "main" java.lang.NullPointerException at org.apache.poi.hssf.record.SSTRecord.getString(SSTRecord.java:309) at org.apache.poi.hssf.model.Workbook.getSSTString(Workbook.java:576) at org.apache.poi.hssf.usermodel.HSSFCell.<init>(HSSFCell.java:305) at org.apache.poi.hssf.usermodel.HSSFRow.createCellFromRecord(HSSFRow.java:233) 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) 2) Exception in thread "main" java.lang.NegativeArraySizeException at org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder(SSTDeserializer.java:335) at org.apache.poi.hssf.record.SSTDeserializer.processContinueRecord(SSTDeserializer.java:320) at org.apache.poi.hssf.record.SSTRecord.processContinueRecord(SSTRecord.java:540) at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:210) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:140) regards.
Can you attach the workbook(s) that fail so we have an easily runnable test case? Jason PS This can be done using the Create new attachment feature in bugzilla.
Created attachment 3027 [details] there are two xls files in archive, which cause exception. Sorry, but String are almost in Japanese.
Please also test this against the HEAD from cvs or against last nights build. A patch was recently applied to it for better handling of Japanese specifically.
if the requested information is not provided in the next week or so I'll close this bug.
Sorry for delaying response, But, Some exception still be thrown. thanks.
Fixed in latest CVS. Thanks Jason... Will go into next release 2.0pre4