You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Darien Kindlund <po...@kindlund.com> on 2004/02/19 01:45:15 UTC
[2.0-RC1-20031102] Potential Bug? Zero Byte OLE Streams (DocumentEntry)?
Hello,
First off, to the developers, thanks so much for providing this open
source initiative! I've been a long-time lurker; first time poster.
Couple of issues:
#1:
Initial Setup: Using 2.0-RC1-20031102 source; utilizing the
org.apache.poifs.filesystem.* libraries exclusively.
After getting hands on with the (non-event-driven) way of
reading/writing OLE streams/storages (aka Documents/Directories in POIFS
speak)... I noticed that POIFS has trouble either *creating* or
*reading* ZERO byte (or empty) OLE streams (Documents).
Here's an easy example:
1) Create a POIFS filesystem.
2) Create 2 DocumentEntry's, one with some bytes, the other with 0 bytes.
3) Save the POIFS filesystem as a file.
4) Attempt to view the subsequent POIFS filesystem in the
org.apache.poi.contrib.poibrowser.POIBrowser
5) ... and you get this error message:
java.io.IOException: Cannot remove block[ 0 ]; out of range
No POI filesystem(s) to display.
... by simply removing the 0 byte DocumentEntry from the POIFS
filesystem, the subsequent saved copy is now readable.
I'm pretty sure the problem resides somewhere in the following function:
public POIFSDocument(final String name, final InputStream stream);
... within org.apache.poi.poifs.filesystem.
My guess, is that the "block[ 0 ]" referred to in the error message may
be from the "DocumentBlock block" instantiation within the while loop...
but not 100% sure.
- Can anyone confirm/deny that this problem exists?
- If it does exist, can anyone indicate if this problem has been fixed?
#2:
Has anyone done a POI integrated port of the Escher filesystem?
(KOffice v1.3 has a decent start in their powerpoint.cc source code...
at least in determining Escher records/containers/atoms, etc.)
Thanks in advance,
Darien Kindlund
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: [2.0-RC1-20031102] Potential Bug? Zero Byte OLE Streams
(DocumentEntry)?
Posted by Avik Sengupta <av...@itellix.com>.
This has been reported before, but no fix yet :(
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11744
Escher support has been comitted recently in CVS, a release is
forthcoming.
Regards
-
Avik
On Thu, 2004-02-19 at 06:15, Darien Kindlund wrote:
> Hello,
>
> First off, to the developers, thanks so much for providing this open
> source initiative! I've been a long-time lurker; first time poster.
>
> Couple of issues:
>
> #1:
> Initial Setup: Using 2.0-RC1-20031102 source; utilizing the
> org.apache.poifs.filesystem.* libraries exclusively.
>
> After getting hands on with the (non-event-driven) way of
> reading/writing OLE streams/storages (aka Documents/Directories in POIFS
> speak)... I noticed that POIFS has trouble either *creating* or
> *reading* ZERO byte (or empty) OLE streams (Documents).
>
> Here's an easy example:
>
> 1) Create a POIFS filesystem.
> 2) Create 2 DocumentEntry's, one with some bytes, the other with 0 bytes.
> 3) Save the POIFS filesystem as a file.
> 4) Attempt to view the subsequent POIFS filesystem in the
> org.apache.poi.contrib.poibrowser.POIBrowser
> 5) ... and you get this error message:
> java.io.IOException: Cannot remove block[ 0 ]; out of range
> No POI filesystem(s) to display.
>
> ... by simply removing the 0 byte DocumentEntry from the POIFS
> filesystem, the subsequent saved copy is now readable.
>
> I'm pretty sure the problem resides somewhere in the following function:
> public POIFSDocument(final String name, final InputStream stream);
> ... within org.apache.poi.poifs.filesystem.
>
> My guess, is that the "block[ 0 ]" referred to in the error message may
> be from the "DocumentBlock block" instantiation within the while loop...
> but not 100% sure.
>
> - Can anyone confirm/deny that this problem exists?
> - If it does exist, can anyone indicate if this problem has been fixed?
>
> #2:
> Has anyone done a POI integrated port of the Escher filesystem?
> (KOffice v1.3 has a decent start in their powerpoint.cc source code...
> at least in determining Escher records/containers/atoms, etc.)
>
> Thanks in advance,
> Darien Kindlund
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: [2.0-RC1-20031102] Potential Bug? Zero Byte OLE Streams (DocumentEntry)?
Posted by Darien Kindlund <po...@kindlund.com>.
Well, I was slightly off as to where the problem may ensue... after
doing a printStackTrace on the exception, I get the following:
java.io.IOException: Cannot remove block[ 0 ]; out of range
at
org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:140)
at
org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:227)
at
org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:165)
at
org.apache.poi.poifs.eventfilesystem.POIFSReader.processProperties(POIFSReader.java:282)
at
org.apache.poi.poifs.eventfilesystem.POIFSReader.read(POIFSReader.java:133)
at org.apache.poi.contrib.poibrowser.POIBrowser.run(POIBrowser.java:129)
at org.apache.poi.contrib.poibrowser.POIBrowser.main(POIBrowser.java:95)
Hope this helps,
Darien
Darien Kindlund wrote:
> Hello,
>
> First off, to the developers, thanks so much for providing this open
> source initiative! I've been a long-time lurker; first time poster.
>
> Couple of issues:
>
> #1:
> Initial Setup: Using 2.0-RC1-20031102 source; utilizing the
> org.apache.poifs.filesystem.* libraries exclusively.
>
> After getting hands on with the (non-event-driven) way of
> reading/writing OLE streams/storages (aka Documents/Directories in
> POIFS speak)... I noticed that POIFS has trouble either *creating* or
> *reading* ZERO byte (or empty) OLE streams (Documents).
>
> Here's an easy example:
>
> 1) Create a POIFS filesystem.
> 2) Create 2 DocumentEntry's, one with some bytes, the other with 0 bytes.
> 3) Save the POIFS filesystem as a file.
> 4) Attempt to view the subsequent POIFS filesystem in the
> org.apache.poi.contrib.poibrowser.POIBrowser
> 5) ... and you get this error message:
> java.io.IOException: Cannot remove block[ 0 ]; out of range
> No POI filesystem(s) to display.
>
> ... by simply removing the 0 byte DocumentEntry from the POIFS
> filesystem, the subsequent saved copy is now readable.
>
> I'm pretty sure the problem resides somewhere in the following function:
> public POIFSDocument(final String name, final InputStream stream);
> ... within org.apache.poi.poifs.filesystem.
>
> My guess, is that the "block[ 0 ]" referred to in the error message
> may be from the "DocumentBlock block" instantiation within the while
> loop... but not 100% sure.
>
> - Can anyone confirm/deny that this problem exists?
> - If it does exist, can anyone indicate if this problem has been fixed?
>
> #2:
> Has anyone done a POI integrated port of the Escher filesystem?
> (KOffice v1.3 has a decent start in their powerpoint.cc source code...
> at least in determining Escher records/containers/atoms, etc.)
>
> Thanks in advance,
> Darien Kindlund
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org