[ 
https://issues.apache.org/jira/browse/FOP-2321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Meyer updated FOP-2321:
------------------------------

    Attachment: patch.diff

After investigating this issue, it stems from the fact that the RTF code cannot 
handle anything other than a simple-page-master reference. This is due to the 
limitation of the RTF implementation we have and without adding this feature 
will unfortunately remain like that. In the case of the original FO 
specification file, the page-sequence is referencing a page-sequence-master 
with a repeatable-page-master. The null pointer exception occurs because it 
tries to read the flow object after looking up and failing to find a 
simple-page-master with the master-reference provided.

I originally created a patch to warn the user if the flow was null and 
recommend to changing the FO to using a simple-page-master reference in the 
page-sequence-master. A side effect of this though was that it bypassed trying 
to read the flow and continued to create the document successfully without it! 
As such I've simply removed the warning from the patch to only create the 
page-master if the flow is not null which seems to work fine. I'll apply this 
patch shortly.

I've created another issue for the missing feature in RTF to support other 
page-master types:

https://issues.apache.org/jira/browse/FOP-2350

> Latest fop snapshot crashes when processing rindolf-spec.fo
> -----------------------------------------------------------
>
>                 Key: FOP-2321
>                 URL: https://issues.apache.org/jira/browse/FOP-2321
>             Project: Fop
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: Mageia Linux Cauldron (what will become Mageia Linux 4) 
> x86-64 with java-1.7.0-openjdk-headless-1.7.0.60-2.4.3.2.mga4 .
>            Reporter: Shlomi Fish
>         Attachments: patch.diff, rindolf-spec.fo.xz
>
>
> When I run this command I get this output (I will attach rindolf-spec.fo 
> soon). I am using /home/shlomif/apps/fop/fop-20131126/fop :
> shlomif[homepage@default]:$trunk$ fop -fo lib/docbook/4/fo/rindolf-spec.fo 
> -rtf lib/docbook/4/rtf/rindolf-spec.rtf
> Nov 27, 2013 10:10:24 AM org.apache.fop.events.LoggingEventListener 
> processEvent
> WARNING: Only simple-page-masters are supported on page-sequences. Using 
> default simple-page-master from page-sequence-master "body". (See position 
> 2:26400)
> Nov 27, 2013 10:10:24 AM org.apache.fop.cli.Main startFOP
> SEVERE: Exception
> org.apache.fop.apps.FOPException
> java.lang.NullPointerException
>         at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288)
>         at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
>         at org.apache.fop.cli.Main.startFOP(Main.java:177)
>         at org.apache.fop.cli.Main.main(Main.java:208)
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.fop.render.rtf.RTFHandler.startPageSequence(RTFHandler.java:221)
>         at 
> org.apache.fop.fo.pagination.PageSequence.startOfNode(PageSequence.java:121)
>         at 
> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:335)
>         at 
> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:178)
>         at 
> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
> Source)
>         at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown 
> Source)
>         at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown 
> Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>  Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
> Source)
>         at 
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
>         at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:285)
>         ... 3 more
> ---------
> java.lang.NullPointerException
>         at 
> org.apache.fop.render.rtf.RTFHandler.startPageSequence(RTFHandler.java:221)
>         at 
> org.apache.fop.fo.pagination.PageSequence.startOfNode(PageSequence.java:121)
>         at 
> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:335)
>         at 
> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:178)
>         at 
> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
> Source)
>         at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown 
> Source)
>         at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown 
> Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>  Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
> Source)
>         at 
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
>         at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:285)
>         at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
>         at org.apache.fop.cli.Main.startFOP(Main.java:177)
>         at org.apache.fop.cli.Main.main(Main.java:208)
> shlomif[homepage@default]:$trunk$ 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to