Bruce Houghton wrote:
False alarm;([EMAIL PROTECTED]&*()_+)
My test bed works fine now, but when I deployed it to
my ISP I still get this error.
I don't know which come first, "ExceptionInInitializerError", or the security error.
I suspect it's Access denied: "java.util.PropertyPermission poi.deserialize.escher read"
Any thoughts?
Log below. Bruce Houghton
Code;
HSSFWorkbook Read() throws IOException { URL url = new URL(Url_Name); URLConnection uc = url.openConnection(); POIFSFileSystem is = new POIFSFileSystem((uc.getInputStream())); HSSFWorkbook wb = new HSSFWorkbook(is); *** 103 This is where the error happens return wb; }
Java(TM) Plug-in: Version 1.4.2_06 Using JRE version 1.4.2_06 Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\Bruce's
Proxy Configuration: No proxy ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging p: reload proxy configuration q: hide console r: reload policy configuration s: dump system properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ---------------------------------------------------- java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.poi.hssf.record.RecordFactory.class$(RecordFactory.java:50) at org.apache.poi.hssf.record.RecordFactory.<clinit>(RecordFactory.java:48) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130) at barry.Excel_Page.Read(Excel_Page.java:103) ***** 103 where error is happening at barry.Excel_Page.Excel(Excel_Page.java:73) at barry.Excel_Page.<init>(Excel_Page.java:50) at barry.Home_Page.MyInit(Home_Page.java:48) at barry.Home_Page.<init>(Home_Page.java:36) at barry.Begin.init(Begin.java:34) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission poi.deserialize.escher read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at org.apache.poi.hssf.record.AbstractEscherHolderRecord.<clinit>(AbstractEscherHolderRecord.java:40) ... 14 more
_____________________________________________________________________________________________________________
----- Original Message ----- From: "Bruce Houghton" <[EMAIL PROTECTED]>
To: "Bruce Houghton" <[EMAIL PROTECTED]>; "POI Users List" <[email protected]>
Sent: Monday, January 10, 2005 6:54 AM
Subject: Re: ExceptionInInitializerError
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/
