Not sure what version of POI you are using. But recently there were messages in this 
user group indicating that POI version 2.5 has issues with reading files with Lists in 
them. Do the excel sheets that cause this problem have Lists in them? Or may be it is 
related to some formula which can't be correctly read by POI.

Take a look at
http://www.mail-archive.com/[EMAIL PROTECTED]/msg03684.html

Hope this helps.

Rahul Phadnis 
BDrive, Inc. 
www.bdrive.com 
Email:[EMAIL PROTECTED]
Phone: 408-4920776
-----------------------------------------------------------------
This life we have is short, so let us leave a mark for people to remember - Kip Keino, 
Kenyan runner

--- ORIGINAL MESSAGE ---
From:[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:RE: poi newbie question
Date: 07/08/2004 01:29:17 PM
Danny,

Thanks for the message.

I checked. And yes the same thing happens when I do "getResoucesAsStream()" from my 
local hard drive, too. So it doesn't seem to be a fileupload problem.

Qingtian

 

> -----Original Message-----
> From: Danny Mui [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 08, 2004 10:05 AM
> To: POI Users List
> Subject: Re: poi newbie question
> 
> 
> Does this happen when you load the workbook directly (not 
> from file upload)?
> 
> What version of HSSF are you using?
> 
> Qingtian Wang wrote:
> 
> > Hi,
> > 
> > I am using POI to parse Excel files uploaded from a JSP (jdk1.4, 
> > j2ee1.3, weblogic8.1).
> > 
> > At times I can successfully parse the Excel file uploaded, 
> but other 
> > times I've got the following error. I am using 
> commons-fileupload to 
> > load the Excel file onto the server; and since I don't see any 
> > exceptions thrown by that package, I guess the problem 
> happens when I 
> > am using POI. (Couldn't figure out why I got the 
> > "org.apache.poi.hssf.record.RecordFormatException" exception.)
> > 
> > I am using the HSSFWorkbook() constructor that takes an 
> InputStream as 
> > the argument. After getting the workbook, I am pretty much looping 
> > over the entire Excel file and printing out the cell 
> values, similar 
> > to the sample code that comes with the POI jar 
> > (org.apache.poi.hssf.dev.HSSF.java).
> > 
> > Can someone please help?
> > 
> > Thanks very much,
> > Q. Wang
> > 
> > 
> > ~~~~~~~
> > 
> > <Jul 7, 2004 5:27:59 PM CDT> <Warning> <HTTP> <BEA-101138> 
> > 
> <ServletContext(id=9039851,name=telescope,context-path=/telesc
> ope) One of the getParameter family of methods called after 
> reading from the ServletInputStream. Not merging post parameters.>
> > [WARNING] Unknown Ptg 3c (60) 
> java.lang.reflect.InvocationTargetException
> >         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> >         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo
> nstructorAccessorImpl.java:39)
> >         at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele
gatingConstructorAccessorImpl.java:27)
> >         at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> >         at 
> org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFa
> ctory.java:224)
> >         at 
> org.apache.poi.hssf.record.RecordFactory.createRecords(RecordF
> actory.java:160)
> >         at 
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook
> .java:165)
> >         at 
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook
> .java:212)
> >         at 
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook
> .java:193)
> >         at 
> com.united.telescope.prototype.Excel.<init>(Unknown Source)
> >         at 
> jsp_servlet._test.__exceldisplay._jspService(__exceldisplay.java:136)
> >         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
> >         at 
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAct
> ion.run(ServletStubImpl.java:971)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:402)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:446)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:305)
> >         at 
> weblogic.servlet.internal.RequestDispatcherImpl.forward(Reques
> tDispatcherImpl.java:301)
> >         at 
> com.united.telescope.prototype.ExcelReader.processRequest(Unkn
> own Source)
> >         at 
> com.united.telescope.prototype.ExcelReader.doPost(Unknown Source)
> >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at 
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAct
> ion.run(ServletStubImpl.java:971)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:402)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:305)
> >         at 
> weblogic.servlet.internal.WebAppServletContext$ServletInvocati
> onAction.run(WebAppServletContext.java:6350)
> >         at 
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authe
> nticatedSubject.java:317)
> >         at 
> weblogic.security.service.SecurityManager.runAs(SecurityManage
> r.java:118)
> >         at 
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(W
> ebAppServletContext.java:3635)
> >         at 
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRe
> questImpl.java:2585)
> >         at 
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> >         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> > Caused by: java.lang.ArrayIndexOutOfBoundsException
> >         at java.lang.System.arraycopy(Native Method)
> >         at 
> org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62)
> >         at 
> org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord
> .java:57)
> >         at 
> org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99)
> >         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.ObjRecord.<init>(ObjRecord.java:61)
> >         ... 31 more
> > org.apache.poi.hssf.record.RecordFormatException: Unable to 
> construct record instance, the following exception occured: null
> >         at 
> org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFa
> ctory.java:237)
> >         at 
> org.apache.poi.hssf.record.RecordFactory.createRecords(RecordF
> actory.java:160)
> >         at 
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook
> .java:165)
> >         at 
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook
> .java:212)
> >         at 
> org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook
> .java:193)
> >         at 
> com.united.telescope.prototype.Excel.<init>(Unknown Source)
> >         at 
> jsp_servlet._test.__exceldisplay._jspService(__exceldisplay.java:136)
> >         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
> >         at 
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAct
> ion.run(ServletStubImpl.java:971)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:402)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:446)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:305)
> >         at 
> weblogic.servlet.internal.RequestDispatcherImpl.forward(Reques
> tDispatcherImpl.java:301)
> >         at 
> com.united.telescope.prototype.ExcelReader.processRequest(Unkn
> own Source)
> >         at 
> com.united.telescope.prototype.ExcelReader.doPost(Unknown Source)
> >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at 
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAct
> ion.run(ServletStubImpl.java:971)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:402)
> >         at 
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java:305)
> >         at 
> weblogic.servlet.internal.WebAppServletContext$ServletInvocati
> onAction.run(WebAppServletContext.java:6350)
> >         at 
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authe
> nticatedSubject.java:317)
> >         at 
> weblogic.security.service.SecurityManager.runAs(SecurityManage
> r.java:118)
> >         at 
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(W
> ebAppServletContext.java:3635)
> >         at 
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRe
> questImpl.java:2585)
> >         at 
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> >         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> > 
> > ~~~~~~~
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to