PowerPointExtractor - java.lang.NegativeArraySizeException

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

PowerPointExtractor - java.lang.NegativeArraySizeException

Stefan Gritzka
Hi!
For my little Lucene application I just tried to implement the
jakarta-poi\src\scratchpad\src\org\apache\poi\hslf\extractor\powerpointextractor
to get the content of .ppt files.
Now my problem: As soon as I try to call any of the three
powerpointextractor constructors I get NegativeArraySizeException. I
changed nothing on the jakarta-poi-code and for example my hssf
implementation to extract .xls works just fine.

Here's some details to the exception:
java.lang.NegativeArraySizeException
    at
org.apache.poi.ddf.EscherClientAnchorRecord.fillFields(EscherClientAnchorRecord.java:72)
    at
org.apache.poi.ddf.EscherContainerRecord.fillFields(EscherContainerRecord.java:53)
    at
org.apache.poi.ddf.EscherContainerRecord.fillFields(EscherContainerRecord.java:53)
    at
org.apache.poi.ddf.EscherContainerRecord.fillFields(EscherContainerRecord.java:53)
    at
org.apache.poi.hslf.record.PPDrawing.findEscherChildren(PPDrawing.java:108)
    at org.apache.poi.hslf.record.PPDrawing.<init>(PPDrawing.java:85)
    at
org.apache.poi.hslf.record.Record.createRecordForType(Record.java:159)
    at org.apache.poi.hslf.record.Record.findChildRecords(Record.java:102)
    at
org.apache.poi.hslf.record.DummyRecordWithChildren.<init>(DummyRecordWithChildren.java:50)
    at
org.apache.poi.hslf.record.Record.createRecordForType(Record.java:155)
    at org.apache.poi.hslf.record.Record.findChildRecords(Record.java:102)
    at org.apache.poi.hslf.HSLFSlideShow.readFIB(HSLFSlideShow.java:173)
    at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:102)
    at
org.apache.poi.hslf.extractor.PowerPointExtractor.<init>(PowerPointExtractor.java:95)

Can anyone help me out a bit? Any help would be appreciated. Thanks in
advance!

Stefan

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

Reply | Threaded
Open this post in threaded view
|

Re: PowerPointExtractor - java.lang.NegativeArraySizeException

Avik Sengupta
Can you please attach the ppt file in question to a bug on our issue
tracker http://issues.apache.org/bugzilla/ ..thanks!

On Wed, 2005-06-01 at 12:04 +0200, Stefan Gritzka wrote:

> Hi!
> For my little Lucene application I just tried to implement the
> jakarta-poi\src\scratchpad\src\org\apache\poi\hslf\extractor\powerpointextractor
> to get the content of .ppt files.
> Now my problem: As soon as I try to call any of the three
> powerpointextractor constructors I get NegativeArraySizeException. I
> changed nothing on the jakarta-poi-code and for example my hssf
> implementation to extract .xls works just fine.
>
> Here's some details to the exception:
> java.lang.NegativeArraySizeException
>     at
> org.apache.poi.ddf.EscherClientAnchorRecord.fillFields(EscherClientAnchorRecord.java:72)
>     at
> org.apache.poi.ddf.EscherContainerRecord.fillFields(EscherContainerRecord.java:53)
>     at
> org.apache.poi.ddf.EscherContainerRecord.fillFields(EscherContainerRecord.java:53)
>     at
> org.apache.poi.ddf.EscherContainerRecord.fillFields(EscherContainerRecord.java:53)
>     at
> org.apache.poi.hslf.record.PPDrawing.findEscherChildren(PPDrawing.java:108)
>     at org.apache.poi.hslf.record.PPDrawing.<init>(PPDrawing.java:85)
>     at
> org.apache.poi.hslf.record.Record.createRecordForType(Record.java:159)
>     at org.apache.poi.hslf.record.Record.findChildRecords(Record.java:102)
>     at
> org.apache.poi.hslf.record.DummyRecordWithChildren.<init>(DummyRecordWithChildren.java:50)
>     at
> org.apache.poi.hslf.record.Record.createRecordForType(Record.java:155)
>     at org.apache.poi.hslf.record.Record.findChildRecords(Record.java:102)
>     at org.apache.poi.hslf.HSLFSlideShow.readFIB(HSLFSlideShow.java:173)
>     at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:102)
>     at
> org.apache.poi.hslf.extractor.PowerPointExtractor.<init>(PowerPointExtractor.java:95)
>
> Can anyone help me out a bit? Any help would be appreciated. Thanks in
> advance!
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
--


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

Reply | Threaded
Open this post in threaded view
|

Re: PowerPointExtractor - java.lang.NegativeArraySizeException

Nick Burch
In reply to this post by Stefan Gritzka
On Wed, 1 Jun 2005, Stefan Gritzka wrote:
> Here's some details to the exception:
> java.lang.NegativeArraySizeException
>   at
> org.apache.poi.ddf.EscherClientAnchorRecord.fillFields(EscherClientAnchorRecord.java:72)
>   at

Can you check to see if you have the latest DDF stuff? There are some
fixes in there (esp. to EscherClientAnchorRecord) that are needed by the
powerpoint code

If you don't have "private boolean shortRecord = false;" on about line 50
of org.apache.poi.ddf.EscherClientAnchorRecord.java, then you'll need to
do a cvs update. If you do, can you attach the PPT file to a new bug, and
I'll take a look at what's wrong

Nick

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

Reply | Threaded
Open this post in threaded view
|

Re: PowerPointExtractor - java.lang.NegativeArraySizeException

Stefan Gritzka
I imported everything new, so this "private boolean shortRecord =
false;" is also in line 50. My PowerPointExtractor does not work for any
ppt-document, not even for a nearly blank one with just one word in it.
So I think, it's more a problem of my surrounding settings rather than a
problem of the extractor itself.

I have to say, that I'm still using jdk 1.3.1_04. To erase some small
compiler errors, I had to make some small changes:
RuntimeExceptions: E.g. in
jakarta-poi\src\scratchpad\src\org\apache\poi\hssf\usermodel\HSSFFormulaEvaluator.java
in line 458 to something like that: "throw new RuntimeException("Fatal
Error: "+ e);"
And line 61, 78, 97 and 123 in
jakarta-poi\src\scratchpad\src\org\apache\poi\hssf\record\formula\eval\RelationalOperationEval
"retval.bs[index] = Boolean.valueOf(be.getBooleanValue());" into
"etval.bs[index] = new Boolean(be.getBooleanValue());". But I don't
think, that these changes have anything to do with my problem...

Perhaps this additional information helps you?

Stefan



Nick Burch schrieb:

> On Wed, 1 Jun 2005, Stefan Gritzka wrote:
>
>> Here's some details to the exception:
>> java.lang.NegativeArraySizeException
>>   at
>> org.apache.poi.ddf.EscherClientAnchorRecord.fillFields(EscherClientAnchorRecord.java:72)
>>
>>   at
>
>
> Can you check to see if you have the latest DDF stuff? There are some
> fixes in there (esp. to EscherClientAnchorRecord) that are needed by
> the powerpoint code
>
> If you don't have "private boolean shortRecord = false;" on about line
> 50 of org.apache.poi.ddf.EscherClientAnchorRecord.java, then you'll
> need to do a cvs update. If you do, can you attach the PPT file to a
> new bug, and I'll take a look at what's wrong
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>


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

Reply | Threaded
Open this post in threaded view
|

Re: PowerPointExtractor - java.lang.NegativeArraySizeException

Nick Burch
On Wed, 1 Jun 2005, Stefan Gritzka wrote:
> I imported everything new, so this "private boolean shortRecord =
> false;" is also in line 50.

OK, that's my first guess gone. Can you add the powerpoint document to
bugzilla?

> My PowerPointExtractor does not work for any ppt-document, not even for
> a nearly blank one with just one word in it. So I think, it's more a
> problem of my surrounding settings rather than a problem of the
> extractor itself.

Can you give it a whirl with the test ppt file?
src/scratchpad/testcases/org/apache/poi/hslf/data/basic_test_ppt_file.ppt

If that one works, I'll need to see what's different about your ppt files
that's breaking DDF when we read in the ppt file. If that one doesn't
work, then can you try running all the unit tests for hslf, and report
which ones work?

Thanks
Nick

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

Reply | Threaded
Open this post in threaded view
|

Re: PowerPointExtractor - java.lang.NegativeArraySizeException

Stefan Gritzka
Nick Burch schrieb:

> On Wed, 1 Jun 2005, Stefan Gritzka wrote:
>
>> I imported everything new, so this "private boolean shortRecord =
>> false;" is also in line 50.
>
>
> OK, that's my first guess gone. Can you add the powerpoint document to
> bugzilla?

Eehm... Ok, I think I made a bad mistake there... You're first guess was
really right: Before the PowerPointExtractor came up, I already had
poi-2.5.1 working in my project... Somehow I simply forgot to remove it
before importing the new version with the extractor. And two different
versions of poi a definitely evil... I'm so sorry :-) And thank you very
much for the help!

So now, it works fine with the test files. But are there any limitations
of what a ppt file may or must have and what is ignored by the
extractor? I have some files with very much text and all I get from the
extractor is about 10 lines. From another file I get a String filled
with one space...

Have a nice day,
Stefan.



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

Reply | Threaded
Open this post in threaded view
|

Re: PowerPointExtractor - java.lang.NegativeArraySizeException

Nick Burch
On Thu, 2 Jun 2005, Stefan Gritzka wrote:
> Eehm... Ok, I think I made a bad mistake there... You're first guess was
> really right: Before the PowerPointExtractor came up, I already had poi-2.5.1
> working in my project... Somehow I simply forgot to remove it before
> importing the new version with the extractor. And two different versions of
> poi a definitely evil... I'm so sorry :-) And thank you very much for the
> help!

No worries, glad it was that easy to fix!

> So now, it works fine with the test files. But are there any limitations
> of what a ppt file may or must have and what is ignored by the
> extractor?

I still haven't figured out exactly how slides indicate which blocks of
text they want.

With Slides, all the text is stored in one place (SlideListWithText), so
powerpoint can give you a list of page titles easily. Each slide then
points (via a method I've yet to fully grok) to the bits of text it uses,
from within one of the common blocks of text.

With notes, the text is just embeded in the note itself, so life is much
easier


So, if you're seeing missing text, then that shows my (rather icky) slide
-> text matching isn't working right. If you could upload a problem file
to bugzilla, that might provide more illumination in just how the linking
works

Nick

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