Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 44648 invoked from network); 10 Jan 2005 11:51:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Jan 2005 11:51:55 -0000 Received: (qmail 70128 invoked by uid 500); 10 Jan 2005 11:51:52 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 70093 invoked by uid 500); 10 Jan 2005 11:51:52 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 70076 invoked by uid 99); 10 Jan 2005 11:51:52 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.tor.primus.ca (HELO smtp-07.primus.ca) (216.254.136.21) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 10 Jan 2005 03:51:50 -0800 Received: from dsl-207-112-47-53.tor.primus.ca ([207.112.47.53] helo=WindowsXP) by smtp-07.primus.ca with asmtp (Exim 3.36 #1) id 1Cny6d-0006PC-0A; Mon, 10 Jan 2005 06:53:07 -0500 Message-ID: <000601c4f70b$18ead2c0$6400a8c0@WindowsXP> From: "Bruce Houghton" To: "Bruce Houghton" , "POI Users List" Subject: Re: ExceptionInInitializerError Date: Mon, 10 Jan 2005 06:54:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N The problem, My program was set up to read files using FileInputStream to open the POIFSFileSystem, or Url.getInputStream to open the POIFSFileSystem. If FileInputStream failed, I would use HTTP. Everything worked fine until I deployed the applet to my ISP where the POIFSFileSystem with FileInputStream caused an IOEXception(of course) and it would then open the POIFSFileSystem with url.getInputStream. I changed the program to use url.getInputStream only where the file name could be either "file:/C:/filename" or "http://www......./filename". And both work fine. BTW, I FTP the .xls file in "Binary" mode. Bruce Houghton ----- Original Message ----- From: "Bruce Houghton" To: "POI Users List" Sent: Friday, January 07, 2005 7:46 AM Subject: Re: ExceptionInInitializerError > HTTP Transmission? > If you mean does it run on my PC under JBuilder > not using HTTP, the answer is yes. > If you mean after deploy the applet to my ISP > and logon to it through the Internet... > Q. Is there another way than HTTP Transmission? > > I changed the "SafePOIStream" to "POIFSFileSystem" > with no change. > > However, when I "FTP" the .xls file to my ISP using > ASCII instead of BINARY I get a different error. > > "java.io.IOException: Unable to read entire block; > 502 bytes read; expected 512 bytes" > > Bruce Houghton > > ----- Original Message ----- > From: "Danny Mui" > To: "POI Users List" > Sent: Thursday, January 06, 2005 1:05 PM > Subject: Re: ExceptionInInitializerError > > >> Does the excel file get parsed correctly without the HTTP Transmission? >> >> I'm not sure you need to the safe stream anymore, the heavy lifters >> (thanks guys!) patched it to accept slow streams. >> >> http://issues.apache.org/bugzilla/show_bug.cgi?id=13478 >> >> Can you also provide a more detailed stack trace so we can guess a >> little better? >> >> Bruce Houghton wrote: >>> To all; >>> I get ExceptionInInitializerError at HSSFWorkbook. >>> I'm using poi...20040804.jar, and JRE1.4.2_04. >>> The URL generated "HTTP://www....../.../barry/images/excel.xls" >>> is correct. Printing the header field shows "HTTP 1.1 200 ok", >>> more messages, then "application/msexcel", date twice >>> then the length of the file. Everything I read points to >>> a compatibility issue. >>> Any thoughts. >>> Bruce Houghton >>> >>> >>> HSSFWorkbook Read1() throws IOException { >>> URL url = new URL(codeBase, "barry/Images/Excel.xls"); >>> URLConnection uc = url.openConnection(); >>> String field = uc.getHeaderField(0); >>> for (int i=0;field != null; i++) { >>> JOptionPane.showMessageDialog(null, field); >>> field = uc.getHeaderField(i); >>> } >>> SafePOIStream is = new SafePOIStream(uc.getInputStream()); >>> HSSFWorkbook wb = new HSSFWorkbook(is); >>> return wb; >>> } >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org >> Mailing List: http://jakarta.apache.org/site/mail2.html#poi >> The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/