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" <[EMAIL PROTECTED]>
To: "POI Users List" <[email protected]>
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" <[EMAIL PROTECTED]>
To: "POI Users List" <[email protected]>
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: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/



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



Reply via email to