When trying to format the attached .fo file, I get the following exception: java.lang.NullPointerException at org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager.addALetterSpaceTo (InlineStackingLayoutManager.java:295) at org.apache.fop.layoutmgr.InlineKnuthSequence.addALetterSpace(InlineKnuthSequence.java:140) at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements (LineLayoutManager.java:679) at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements (LineLayoutManager.java:582) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements (BlockStackingLayoutManager.java:275) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements (BlockLayoutManager.java:105) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements (BlockStackingLayoutManager.java:275) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements (BlockLayoutManager.java:105) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements (BlockStackingLayoutManager.java:275) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements (BlockLayoutManager.java:105) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java: 98) at org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthElements (PageSequenceLayoutManager.java:240) at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:510) at org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList (PageSequenceLayoutManager.java:232) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:259) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:227) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout (PageSequenceLayoutManager.java:153) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:381) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:147) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:358) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:193) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement (TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(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.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java: 484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:164) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114) at org.apache.fop.cli.Main.startFOP(Main.java:159) at org.apache.fop.cli.Main.main(Main.java:190)
Created attachment 18264 [details] sample fo file forgot to mention my fop version: svn checkout from today (5/12)
Created attachment 18265 [details] Patch file for the bug presented I've written a small fix that fixes the symptoms. This is probably a very bad idea, someone that actually knows why this error is occuring should fix this. However, the attached patch "works for me"
Created attachment 18308 [details] A minimal fo file for the problem The NPE is caused by FOP's efforts to add a letter space to a box for padding. It is triggered by the combination of NBSPACE, padding and an immediately following inline level fo element. I am still studying the best way to prevent this bug. Checking whether the box is an InlineBox, like you do in your patch, is a good option.
Patch applied, with a few modifications, in revision 407819. Thanks. This patch is certainly not a definitive solution, rather it is an emergeny patch. The problem is part of the range of problems with inline handling, signalled earlier this year by Manuel Mall.
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed