I've tried to generate a pdf-document, but while transforming the generated fo-document to pdf, fop is throwing an NullPointerException: 08.01.2008 10:18:09 org.apache.fop.cli.Main startFOP SCHWERWIEGEND: Exception java.lang.NullPointerException at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197) --------- java.lang.NullPointerException at org.apache.fop.layoutmgr.table.RowPainter.addAreasAndFlushRow(RowPain ter.java:149) at org.apache.fop.layoutmgr.table.TableContentLayoutManager.iterateAndPa intPositions(TableContentLayoutManager.java:757) at org.apache.fop.layoutmgr.table.TableContentLayoutManager.addAreas(Tab leContentLayoutManager.java:694) at org.apache.fop.layoutmgr.table.TableLayoutManager.addAreas(TableLayou tManager.java:334) at org.apache.fop.layoutmgr.AreaAdditionUtil.addAreas(AreaAdditionUtil.j ava:118) at org.apache.fop.layoutmgr.FlowLayoutManager.addAreas(FlowLayoutManager .java:297) at org.apache.fop.layoutmgr.PageBreaker.addAreas(PageBreaker.java:241) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.jav a:507) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.jav a:370) at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:262) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.jav a:345) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.jav a:263) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(Pag eSequenceLayoutManager.java:144) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.j ava:233) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java :145) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilde r.java:378) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Trans formerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known 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.xalan.transformer.TransformerIdentityImpl.transform(Transf ormerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197) Der Befehl "foo.pdf" ist entweder falsch geschrieben oder konnte nicht gefunden werden. Drücken Sie eine beliebige Taste . . . funny, but with elder versions (0.93 instead of 0.94) this worked fine ...
Created attachment 21354 [details] generated fo-file
In the first table in the fo:flow, you specified 2 columns but due to a number-columns-spanned="2" on the second cell the row would actually span 3 columns. In FOP Trunk there is already a change that warns you about that so this exact problem doesn't appear anymore in the latest dev code. Simply remove the number-columns-spanned attributes and your document should be processed without errors.
Sorry, a mistake on my side: The NPE remains even with the proposed change. I've tested with the wrong JAR. Still, the NPE doesn't happen in the latest FOP Trunk code. Maybe you can use that for the time being. Obviously, a certain risk is involved when using FOP Trunk as it may not be stable. BTW, you should maybe pay a little attention to what FOP warns you about. There are a number of problems in your FO code.
Sorry for reopening this issue. Is there any possibility to avoid this NPE in version 0.94? Otherwise I' think I'll need the trunk-version. But how can I get this as an binary distribution?
No problem. The hot spot is easy to identify if you comment out all tables and enable one after the other until the exception happens. The error seems to happen with those tables that have only one table-cell in the table-body with only an empty fo:block. If you can avoid these, the error seems to go away. Should be easy to work around. Otherwise, there is no binary for FOP Trunk. You'd have to build FOP yourself. That's not a big deal, though. Just follow the instructions on the FOP website. Just reopen in case you need additional help.
batch transition to closed remaining pre-FOP1.0 resolved bugs