You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Narasimhan, Shyamala" <Sh...@owens-minor.com> on 2003/08/15 20:07:26 UTC

hssf upload file issue

Hi

I am trying to convert (to hssf) an xls file uploaded through struts on a
weblogic server.. the file gets converted if I use a standalone java
application but fails when uploaded through the web. The file contains more
than 2000 rows. This is the code that converts the file

 

      // get the file from form

        FormFile prodFile = uploadForm.getFile();

        String fileName = prodFile.getFileName();

        log__.info("file name = " + fileName + "... fileSize = " +
prodFile.getFileSize());

        POIFSFileSystem fs = new POIFSFileSystem(prodFile.getInputStream());

 

        HSSFWorkbook wb = null;

        try {

          wb = new HSSFWorkbook(fs);

        }

        catch (Exception e){

          e.printStackTrace();

        }

 

This is the error that I am getting

java.lang.NegativeArraySizeException

        at
org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder(SSTDes

erializer.java:335)

        at
org.apache.poi.hssf.record.SSTDeserializer.processContinueRecord(SSTD

eserializer.java:320)

        at
org.apache.poi.hssf.record.SSTRecord.processContinueRecord(SSTRecord.

java:539)

        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.

java:218)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1

91)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1

58)

        at
com.om.client.ui.struts.action.pmf.supplierfeed.UploadProductListActi

on.perform(UploadProductListAction.java:102)

 

can anybody pls help.

Thanks

Shyamala.