You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Jim Cobban <jc...@magma.ca> on 2003/01/06 18:57:48 UTC

Problem running HSSF eventmodel on multiple spreadsheets

I am using HSSF eventmodel to read spreadsheets in a Swing GUI app.  I have permitted the user to select multiple spreadsheets to read from a FileChooser dialog.  For each spreadsheet I create a separate InternalFrame object and in that object I invoke the HSSF eventmodel to read the spreadsheet associated with the frame.  Within my code all of the objects associated with the frame are unique to the frame.  I am encountering random exceptions when I attempt to process more than one spreadsheet at a time.  The exceptions I have looked at seem to say that the data read from the spreadsheet has been corrupted before it is examined by the decode logic.

In sumary for each spreadsheet selected by the user I create an object which allocates the frame, and sets up the HSSF eventmodel objects.  I then invoke the factory on a separate thread which dispatches the records back to the Swing thread by means of SwingUtilities.invokeLater().  So the factories are running on multiple threads, but each has its own objects so that should not matter.


Jim Cobban   jcobban@magma.ca
34 Palomino Dr.
Kanata, ON, CANADA
K2M 1M1
+1-613-592-9438

Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Andrew C. Oliver" <ac...@apache.org>
Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets


> did you turn logging on?  You should never use POI's logging.

I have no idea how to turn loggin on.  I just added the .jar to my class
path and fired up my application.


Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by "Andrew C. Oliver" <ac...@apache.org>.
did you turn logging on?  You should never use POI's logging.

Jim Cobban wrote:

>----- Original Message -----
>From: "Vikas Pathak" <vp...@qwest.com>
>Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets
>
>
>  
>
>>Use the latest version jakarta-poi-1.8.0-dev-20020919.jar.It will work
>>    
>>
>fine.
>
>I tried using that version, my program gets nowhere because System.out is
>flooded with messages of the form:
>
>creating 253
>creating 253
>creating 189
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 189
>creating 253
>creating 253
>creating 253
>creating 253
>creating 189
>creating 253
>creating 189
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 189
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 253
>creating 189
>...
>
>I did not issue those messages, and I'll be damned if I am going to search
>through all of the source code to find out who is issuing them.  But so much
>time is spent generating those messages that the work I have asked POI to do
>never gets done.
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>




Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Vikas Pathak" <vp...@qwest.com>
Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets


> Use the latest version jakarta-poi-1.8.0-dev-20020919.jar.It will work
fine.

I tried using that version, my program gets nowhere because System.out is
flooded with messages of the form:

creating 253
creating 253
creating 189
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 189
creating 253
creating 253
creating 253
creating 253
creating 189
creating 253
creating 189
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 189
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 253
creating 189
...

I did not issue those messages, and I'll be damned if I am going to search
through all of the source code to find out who is issuing them.  But so much
time is spent generating those messages that the work I have asked POI to do
never gets done.


Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by "Andrew C. Oliver" <ac...@apache.org>.
It is a dev build.  However increased stabillity is a feature.  Or 
rather POI making progress in understanding a given file format is in 
itself a feature and hence leads to stabillity.

The biggest threat to stabillity is it tries to interperate formulas and 
can choke on them too.
1.5.1 ignores them.

I consider 1.8.x more stable on the whole.

-Andy

Jim Cobban wrote:

>----- Original Message -----
>From: "Vikas Pathak" <vp...@qwest.com>
>Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets
>
>
>  
>
>>Use the latest version jakarta-poi-1.8.0-dev-20020919.jar.It will work
>>    
>>
>fine.
>
>Silly me.  I see something labelled "dev" and I assume it is unstable.  I
>see something labelled "final" and I assume it is stable.
>
>Still this is a good point.
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>




Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Vikas Pathak" <vp...@qwest.com>
Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets


> Use the latest version jakarta-poi-1.8.0-dev-20020919.jar.It will work
fine.

Silly me.  I see something labelled "dev" and I assume it is unstable.  I
see something labelled "final" and I assume it is stable.

Still this is a good point.


Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by Vikas Pathak <vp...@qwest.com>.
Hi,
     please don't use the jakarta-poi-1.5.1-final-20020615.jar version. It's
having some problem

Use the latest version jakarta-poi-1.8.0-dev-20020919.jar.It will work fine.

Thanks
Kalpana Kanniappan

Jim Cobban wrote:

> ----- Original Message -----
> From: "Andrew C. Oliver" <ac...@apache.org>
> Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets
>
> > Does the error smell like this:
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15807
> >
> No, the exceptions are truly random problems, for example attempting to
> allocate an array with a negative size, which arise when the code attempts
> to interpret the data which has been read in.  It would appear that the data
> read from the spreadsheet has been corrupted before the decode logic gets a
> chance to look at it.  The exceptions do not occur if I read one spreadsheet
> at a time, only if I attempt to read multiple spreadsheets in concurrent
> threads.
>
> For details I am running Win 98. JDK 1.3.1, and
> jakarta-poi-1.5.1-final-20020615.jar
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by "Andrew C. Oliver" <ac...@apache.org>.
Can you see if it happens with 1.8.x or the HEAD?

Can you provide a small piece of runnable code, the most minimal needed 
to replicate the problem with some sample sheets?

Jim Cobban wrote:

>----- Original Message -----
>From: "Andrew C. Oliver" <ac...@apache.org>
>Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets
>
>
>  
>
>>Does the error smell like this:
>>
>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15807
>>
>>    
>>
>No, the exceptions are truly random problems, for example attempting to
>allocate an array with a negative size, which arise when the code attempts
>to interpret the data which has been read in.  It would appear that the data
>read from the spreadsheet has been corrupted before the decode logic gets a
>chance to look at it.  The exceptions do not occur if I read one spreadsheet
>at a time, only if I attempt to read multiple spreadsheets in concurrent
>threads.
>
>For details I am running Win 98. JDK 1.3.1, and
>jakarta-poi-1.5.1-final-20020615.jar
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>




Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Andrew C. Oliver" <ac...@apache.org>
Subject: Re: Problem running HSSF eventmodel on multiple spreadsheets


> Does the error smell like this:
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15807
>
No, the exceptions are truly random problems, for example attempting to
allocate an array with a negative size, which arise when the code attempts
to interpret the data which has been read in.  It would appear that the data
read from the spreadsheet has been corrupted before the decode logic gets a
chance to look at it.  The exceptions do not occur if I read one spreadsheet
at a time, only if I attempt to read multiple spreadsheets in concurrent
threads.

For details I am running Win 98. JDK 1.3.1, and
jakarta-poi-1.5.1-final-20020615.jar


Re: Problem running HSSF eventmodel on multiple spreadsheets

Posted by "Andrew C. Oliver" <ac...@apache.org>.
Does the error smell like this:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15807

I bet the filesystem isn't producing blocks of 512 the way POIFS expects 
them.  This is a long running bug.  If someone submit a patch 
(http://jakarta.apache.org/poi/getinvolved.html), I'll apply it.

Jim Cobban wrote:

>I am using HSSF eventmodel to read spreadsheets in a Swing GUI app.  I have permitted the user to select multiple spreadsheets to read from a FileChooser dialog.  For each spreadsheet I create a separate InternalFrame object and in that object I invoke the HSSF eventmodel to read the spreadsheet associated with the frame.  Within my code all of the objects associated with the frame are unique to the frame.  I am encountering random exceptions when I attempt to process more than one spreadsheet at a time.  The exceptions I have looked at seem to say that the data read from the spreadsheet has been corrupted before it is examined by the decode logic.
>
>In sumary for each spreadsheet selected by the user I create an object which allocates the frame, and sets up the HSSF eventmodel objects.  I then invoke the factory on a separate thread which dispatches the records back to the Swing thread by means of SwingUtilities.invokeLater().  So the factories are running on multiple threads, but each has its own objects so that should not matter.
>
>
>Jim Cobban   jcobban@magma.ca
>34 Palomino Dr.
>Kanata, ON, CANADA
>K2M 1M1
>+1-613-592-9438
>  
>