Error reading excel file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error reading excel file

nikita rao
Hi all,

  I am using HSSF in my web application to read an
excel file uploaded by the user. The application is
struts based and the input stream from the
struts.upload.FormFile object is passed to the
POIFSFileSystem constructor. I am getting the
following error when trying to parse a particular
excel file:

java.lang.reflect.InvocationTargetException:
java.lang.ArrayIndexOutOfBoundsException: 11
        at
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java(Inlined
Compiled Code))
        at
org.apache.poi.util.LittleEndian.getShort(LittleEndian.java(Compiled
Code))
        at
org.apache.poi.hssf.record.MulRKRecord.fillFields(MulRKRecord.java:153)
        at
org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
        at
org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at
org.apache.poi.hssf.record.MulRKRecord.<init>(MulRKRecord.java:65)


However a stand alone test class using HSSF parses the
same file without any problem. I am using POI ver 2.5
.

I dont know where to start debugging :-(

Has anyone encountered similar problems, please let me
know.

Thanks in advance,

nikita.

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply | Threaded
Open this post in threaded view
|

Re: Error reading excel file

Avik Sengupta
To start debugging, save the file to disk from struts, and then use POI
on it.. it will give you an idea of where to look.


On Fri, 2005-05-20 at 11:56 +0100, nikita rao wrote:

> Hi all,
>
>   I am using HSSF in my web application to read an
> excel file uploaded by the user. The application is
> struts based and the input stream from the
> struts.upload.FormFile object is passed to the
> POIFSFileSystem constructor. I am getting the
> following error when trying to parse a particular
> excel file:
>
> java.lang.reflect.InvocationTargetException:
> java.lang.ArrayIndexOutOfBoundsException: 11
> at
> org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java(Inlined
> Compiled Code))
> at
> org.apache.poi.util.LittleEndian.getShort(LittleEndian.java(Compiled
> Code))
> at
> org.apache.poi.hssf.record.MulRKRecord.fillFields(MulRKRecord.java:153)
> at
> org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
> at
> org.apache.poi.hssf.record.Record.<init>(Record.java:55)
> at
> org.apache.poi.hssf.record.MulRKRecord.<init>(MulRKRecord.java:65)
>
>
> However a stand alone test class using HSSF parses the
> same file without any problem. I am using POI ver 2.5
> .
>
> I dont know where to start debugging :-(
>
> Has anyone encountered similar problems, please let me
> know.
>
> Thanks in advance,
>
> nikita.
>
> ________________________________________________________________________
> Yahoo! India Matrimony: Find your life partner online
> Go to: http://yahoo.shaadi.com/india-matrimony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
--


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply | Threaded
Open this post in threaded view
|

Re: Error reading excel file

nikita rao
In reply to this post by nikita rao
Hi,

  I saved the file to disk from struts and when i try
to open the excel file, i get a message "Damage to the
file was so extensive that repairs were not possible.
Excel attempted to recover your formulas and values,
but some data may have been lost or corrupted."

I guess the file is getting corrupted during upload.
Any reason for this,

Thanks Avik for ur prompt response,


Regards
nikita.


--- Avik Sengupta <[hidden email]> wrote:

> To start debugging, save the file to disk from
> struts, and then use POI
> on it.. it will give you an idea of where to look.
>
>
> On Fri, 2005-05-20 at 11:56 +0100, nikita rao wrote:
> > Hi all,
> >
> >   I am using HSSF in my web application to read an
> > excel file uploaded by the user. The application
> is
> > struts based and the input stream from the
> > struts.upload.FormFile object is passed to the
> > POIFSFileSystem constructor. I am getting the
> > following error when trying to parse a particular
> > excel file:
> >
> > java.lang.reflect.InvocationTargetException:
> > java.lang.ArrayIndexOutOfBoundsException: 11
> > at
> >
>
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java(Inlined
> > Compiled Code))
> > at
> >
>
org.apache.poi.util.LittleEndian.getShort(LittleEndian.java(Compiled
> > Code))
> > at
> >
>
org.apache.poi.hssf.record.MulRKRecord.fillFields(MulRKRecord.java:153)
> > at
> >
>
org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
> > at
> >
>
org.apache.poi.hssf.record.Record.<init>(Record.java:55)
> > at
> >
>
org.apache.poi.hssf.record.MulRKRecord.<init>(MulRKRecord.java:65)

> >
> >
> > However a stand alone test class using HSSF parses
> the
> > same file without any problem. I am using POI ver
> 2.5
> > .
> >
> > I dont know where to start debugging :-(
> >
> > Has anyone encountered similar problems, please
> let me
> > know.
> >
> > Thanks in advance,
> >
> > nikita.
> >
> >
>
________________________________________________________________________
> > Yahoo! India Matrimony: Find your life partner
> online
> > Go to: http://yahoo.shaadi.com/india-matrimony
> >
> >
>
---------------------------------------------------------------------

> > To unsubscribe, e-mail:
> [hidden email]
> > Mailing List:    
> http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:
> http://jakarta.apache.org/poi/
> >
> --
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> Mailing List:    
> http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:
> http://jakarta.apache.org/poi/
>
>

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/