would be best if we grab security exception here and consider it to be
null if we can't read the property...
Alexis A. Trafelati wrote:
Well, finally me and my bodies could solve this issue.
And there is an interesting thing someone could find useful:
The line I was talking about:
RecordFactory.createRecords(stream);
triggers the load of a lot of classes in a static block of code.
One of those classes is
org.apache.poi.hssf.record.AbstractEscherHolderRecord.
That class includes static code too... this line:
private static final boolean DESERIALISE =
System.getProperty("poi.deserialize.escher") != null;
Well, here was the problem located. It was a permissions issue, and we solve
it adding
this to the site policies:
permission java.util.PropertyPermission "poi.deserialize.escher", "read";
Considering the error informed was "java.lang.NoClassDefFoundError",
it was a pretty dificult thing to solve, isn't it?
Good luck!
Alexis.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "POI Users List" <[email protected]>
Sent: Monday, November 21, 2005 8:26 PM
Subject: Re: Creating Workbook: java.lang.NoClassDefFoundError
I'm using Java 1.3.1_10 and I just tried creating a Workbook with "new
HSSFWorkbook(POIFSFileSystem)" and it worked fine.
"Alexis A. Trafelati" <[EMAIL PROTECTED]> wrote on 22/11/2005
09:55:20:
In fact, I'm using the jar supplied in the installation:
poi-2.5.1-final-20040804.jar.
It works with the other environments... but not this one.
And I'm sure I'm running under Java 1.4.2, I even check that setting up
a
script with this piece of code:
System.getProperty("java.version");
It returned 1.4.2.
I also tried to run this segment of code, in a script of my own:
List records;
and it worked. But this line didn't:
RecordFactory.createRecords(stream);
so java.util.List is not the problem, RecordFactory is.
Is anyone using this package with versions of Java equal or older than
1.4.2???
Are you able to create Workbooks with the "new HSSFWorkbook(is)"
function?
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "POI Users List" <[email protected]>
Sent: Monday, November 21, 2005 7:36 PM
Subject: Re: Creating Workbook: java.lang.NoClassDefFoundError
It's an interesting section of code. The RecordFactory class is
deprecated
with the comment "use EventRecordFactory instead".
Even more interesting, the previous line in HSSFWorkbook creates an
EventRecordFactory object but doesn't use it.
EventRecordFactory factory = new EventRecordFactory();
Looks like a bit of half finished code....
Are you using some kind of jar file shrinker that removes deprecated
classes??
Another possibility is that you are running in Java1.1 which doesn't
have
the java.util.List interface.
"Alexis A. Trafelati" <[EMAIL PROTECTED]>
22/11/2005 08:00
Please respond to
"POI Users List" <[email protected]>
To
<[email protected]>
cc
Subject
Creating Workbook: java.lang.NoClassDefFoundError
Hello,
Is there any known problem with any version of the jdk1.4.2???
I'm trying to create a HSSFWorkbook from within a servlet and read it,
and
in several environments it works OK.
It works in an Apache Tomcat 5.5, jdk 1.5.0_04 in a Windows XP
machine.
It works in an Apache Tomcat 4.0.6, jdk 1.4.2_06 in a Linux machine.
But I need to install my app in a machine with the Ensim Control
Panel,
with this configuration:
Tomcat 4.0.6 (a special version), jdk 1.4.2 (don't know exactly the
build)
in Linux.
Here is the code that triggers the java.lang.NoClassDefFoundError:
POIFSFileSystem fs = new POIFSFileSystem(new
FileInputStream(fileName));
HSSFWorkbook workbook = new HSSFWorkbook(fs);
With the Stack Trace I think I tracked down the error to this line of
the
source code, in the
org.apache.poi.hssf.usermodel.HSSFWorkbook class:
List records = RecordFactory.createRecords(stream);
I think the problem is when trying to access the class
org.apache.poi.hssf.record.RecordFactory.
The Stack Trace is below these lines.
Rings any bell?
------------------------------------
java.lang.NoClassDefFoundError
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)
at org.apache.jsp.import3$jsp._jspService(import3$jsp .java:187)
at org.apache.jasper.runtime.HttpJspBase.service(Http
JspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra
pper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFil
e(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationDispatcher.inv
oke(ApplicationDispatcher.java:683)
at org.apache.catalina.core.ApplicationDispatcher.doI
nclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.acc
ess$100(ApplicationDispatcher.java:115)
at org.apache.catalina.core.ApplicationDispatcher$Pri
vilegedInclude.run(ApplicationDispatcher.java:146)
at java.security.AccessController.doPrivileged(Native Method)
....
_____________________________________________________________________
This email message (including any file attachments transmitted with
it) is
for the sole use of the individual or entity to whom it is addressed and
may
contain confidential and privileged information. Any unauthorised
review,
use, alteration, disclosure or distribution is prohibited. If you have
received this email in error, please notify the sender by return email
and
destroy all copies of the original message.
Any confidentiality or legal professional privilege is not waived or
lost
by any mistaken delivery of the email.
Opinions, conclusions and other information in this message that do
not
relate to the official business of the company shall be understood as
neither given nor endorsed by it.
---------------------------------------------------------------------
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/
_____________________________________________________________________
This email message (including any file attachments transmitted with it) is
for the sole use of the individual or entity to whom it is addressed and may
contain confidential and privileged information. Any unauthorised review,
use, alteration, disclosure or distribution is prohibited. If you have
received this email in error, please notify the sender by return email and
destroy all copies of the original message.
Any confidentiality or legal professional privilege is not waived or lost
by any mistaken delivery of the email.
Opinions, conclusions and other information in this message that do not
relate to the official business of the company shall be understood as
neither given nor endorsed by it.
---------------------------------------------------------------------
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/
--
Andrew C. Oliver
SuperLink Software, Inc.
Java to Excel using POI
http://www.superlinksoftware.com/services/poi
Commercial support including features added/implemented, bugs fixed.
---------------------------------------------------------------------
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/