Return-Path: Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 11015 invoked from network); 11 Mar 2003 19:23:24 -0000 Received: from sbcsmtp2.sbc.com (209.184.203.4) by daedalus.apache.org with SMTP; 11 Mar 2003 19:23:24 -0000 Received: from sbc.com (localhost [127.0.0.1]) by sbcsmtp2.sbc.com (8.12.5/8.12.5) with ESMTP id h2BJNTju025078 for ; Tue, 11 Mar 2003 13:23:29 -0600 (CST) Received: from MSGSTLHUB02.ITServices.sbc.com (msgstlhub02.sbc.com [132.201.87.59]) by sbcsmtp2.sbc.com (8.12.5/8.12.5) with ESMTP id h2BJNN0d025045 for ; Tue, 11 Mar 2003 13:23:23 -0600 (CST) Received: by MSGSTLHUB02.ITServices.sbc.com with Internet Mail Service (5.5.2654.52) id ; Tue, 11 Mar 2003 13:23:23 -0600 Message-ID: <7FC80BEFB9ECD411B9FA0002A5137A0B04A1508D@msgstl09.sbc.com> From: "DRINKARD, JAMES E (SBCSI)" To: "'POI Users List'" Subject: RE: FW: Problem reading in a file Date: Tue, 11 Mar 2003 13:22:59 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2654.52) Content-Type: text/plain; charset="ISO-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Maybe, but I should have seen this in the code a lot quicker too. -----Original Message----- From: Danny Mui [mailto:danny@muibros.com] Sent: Tuesday, March 11, 2003 1:21 PM To: POI Users List Subject: Re: FW: Problem reading in a file So I guess we need a better error message for that case. I'm entering a bugzilla entry as an enhancement, vote for it! Currently tackling some other things but will look at it when time permits. danny DRINKARD, JAMES E (SBCSI) wrote: >My code was correct where I was reading in the file. I missed code above >that point where I created a new file with 0 bytes. It didn't have any data >or a header, so I got the error. > >-----Original Message----- >From: Danny Mui [mailto:danny@muibros.com] >Sent: Tuesday, March 11, 2003 12:01 PM >To: DRINKARD, JAMES E (SBCSI) >Subject: Re: Problem reading in a file > > >I got that error once before when the file I was reading was 0 bytes. >Make sure the file does have something in it. > >danny > >DRINKARD, JAMES E (SBCSI) wrote: > > > >>Hello All, >>I'm trying to read in an excel file and I keep getting an error due to it >>not being able to read the header? I made the file using POI and then >>populated it with data. That part works fine. Then I try to read that file >>in order to change it using the following code: >> >>try >> { >> POIFSFileSystem fs = new POIFSFileSystem(new >>FileInputStream(fileName)); >> HSSFWorkbook wrkBk = new HSSFWorkbook(fs); >> >>fileName is a string variable with the filename and path: ie >>"c:\temp\test.xls". >> >>The error is: >>java.io.IOException: Unable to read entire header; -1 bytes read; expected >>512 bytes >>java.io.IOException: Unable to read entire header; -1 bytes read; expected >>512 bytes >> at >>org.apache.poi.poifs.storage.HeaderBlockReader.(HeaderBlockReader.ja v >> >> >a > > >>:114) >> at >>org.apache.poi.poifs.filesystem.POIFSFileSystem.(POIFSFileSystem.jav a >> >> >: > > >>120) >> at >>com.sbc.ecom.iris.batch.reports.totals.Totals.main(Totals.java:303) >> >>I know from other documentation I read that the header gets read first, so >>if it can't find it or interpret it, I assume this is the error one would >>get. >> >>Any ideas as to what I'm doing wrong? >> >>Thanks, >>James >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: poi-user-help@jakarta.apache.org >> >> >> >> >> > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: poi-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: poi-user-help@jakarta.apache.org