Bug 30138 - NullPointerException in rtf-renderer
Summary: NullPointerException in rtf-renderer
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: PC Linux
: P3 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-16 07:48 UTC by la
Modified: 2012-04-01 06:47 UTC (History)
0 users



Attachments
fo file that causes the bug (81.53 KB, text/plain)
2004-07-16 07:49 UTC, la
Details
Slashed down version of bug.fo (46.19 KB, text/plain)
2004-07-16 13:12 UTC, la
Details

Note You need to log in before you can comment on or make changes to this bug.
Description la 2004-07-16 07:48:14 UTC
When trying to convert the attached fo-file to rtf using the fop.sh shell
script, the renderer reproducingly crashes with the following NullPointerException:

------------

Exception in thread "main" java.lang.NullPointerException
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListTable.writeListTableEntry(RtfListTable.java:191)
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListTable.writeRtfContent(RtfListTable.java:136)
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement.writeRtf(RtfElement.java:86)
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer.writeRtfContent(RtfContainer.java:135)
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement.writeRtf(RtfElement.java:86)
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer.writeRtfContent(RtfContainer.java:135)
        at
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement.writeRtf(RtfElement.java:86)
        at org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile.flush(RtfFile.java:219)
        at org.apache.fop.render.rtf.RTFHandler.endDocument(RTFHandler.java:157)
        at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:224)
        at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(Unknown
Source)
        at
org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.fop.apps.Driver.render(Driver.java:230)
        at org.apache.fop.apps.Driver.render(Driver.java:203)
        at org.apache.fop.apps.Fop.main(Fop.java:57)

---------------------

The code base is that of 2004-07-16 around 9.00 MEZ (head).

Commenting out the offending line 191 in RtfListTable caused the conversion to
run through, though resulting in not conformant rtf.

The same file converted OK with a fop version that was approximately three
months old (also head).

The fo is produced using the current docbook stylesheets, originating from a
docbook source.
Comment 1 la 2004-07-16 07:49:43 UTC
Created attachment 12125 [details]
fo file that causes the bug
Comment 2 Glen Mazza 2004-07-16 10:43:42 UTC
Marc

Your input FO File isn't working on my machine because it's requesting a lot of
graphics that you did not attach.  I'm getting too many other errors.

I asked you for a minimal FO file to reproduce the error.  You sent me a
910-line file that's requesting several graphics instead.  

Note:  do not attach the graphics, rather, again, reduce the FO to its minimal
size that causes this error to occur.  When you're willing to do so, please
re-open this bug--your FO file you send us should probably be under 150 lines.

Glen
Comment 3 Glen Mazza 2004-07-16 10:56:29 UTC
Marc,

I added a NPE check to the code, the error should no longer occur.  The code in
question was added 4 months, 10 days ago.

There may be other formatting problems still, however, if that is the case
please reopen the bug or create new ones as appropriate.

Glen
Comment 4 la 2004-07-16 13:10:56 UTC
Thanks for your help. 
 
Unfortunately, the error persists also with the new version. I've attached a 
slashed down version of bug.fo (some 180 lines) that still produces the same 
NullPointerException.
Comment 5 la 2004-07-16 13:12:06 UTC
Created attachment 12127 [details]
Slashed down version of bug.fo
Comment 6 Peter Herweg 2004-07-17 13:25:03 UTC
Hi,

this error was caused by the fact, that the rtf renderer did not set an rtf 
style to the list. I've set the bullet list as default style, so the processing 
of your file should not crash anymore.

But it may not look like you expect. Guess i have to invest some time in 
support for lists in near future.

I set this bug to FIXED.

Kind regards
Peter Herweg
Comment 7 Glen Mazza 2004-07-17 14:20:54 UTC
Vielen Dank, Herr Herweg.  Ich bin sehr froh, dass dieser Bug nicht mein Fehler 
war! ;)

Glen
Comment 8 la 2004-07-19 11:50:44 UTC
Thanks und vielen Dank!
Comment 9 Glenn Adams 2012-04-01 06:47:11 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed