You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Wilhelm <wi...@fh-kl.de> on 2012/07/24 13:31:52 UTC

Re: fop and hyphenation produces NullPointerException [SOLVED with workaround]

Hi,

Am 23.07.2012 14:54, schrieb mehdi houshmand:
> Hi Wilhelm,
>
> I've take a look at this issue, and it's definitely on the complex side
> and I don't really have the time to address this at present. Could you
> explain why you need that empty <fo:inline> element? Removing that
> inline construct would solve your issue in the short term (obviously not
> an actual fix for this bug.)

with the following workaround it works as expected:

<xsl:param name="hyphenate">true</xsl:param>

<xsl:template match="anchor">
   <xsl:variable name="id">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <fo:inline id="{$id}"></fo:inline>
</xsl:template>


>
> Hope that helps
>
> Mehdi
>
> On 23 July 2012 12:23, Pascal Sancho <psancho.asf@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Hi,
>
>     I think this is the same as another issue [1].
>
>     [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=48765
>
>     2012/7/23 mehdi houshmand <med1985@gmail.com
>     <ma...@gmail.com>>:
>      > Hi Wilhelm,
>      >
>      > I've created a bug[1] to track this issue, I'll investigate and
>     post any
>      > findings.
>      >
>      > Mehdi
>      >
>      > [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=53586
>      >
>      >
>      > On 21 July 2012 17:00, Wilhelm <wilhelm.meier@fh-kl.de
>     <ma...@fh-kl.de>> wrote:
>      >>
>      >> Am 21.07.2012 14 <tel:21.07.2012%2014>:22, schrieb mehdi houshmand:
>      >>
>      >>> Hi,
>      >>>
>      >>> This looks like the NPE is occurring during layout, could you
>     please
>      >>> provide the FO that causes this issue? If you could, try and
>     cut down
>      >>> the FO as minimal as possible, just so that whomever looks at
>     this issue
>      >>> can find the problem as quickly as possible.
>      >>
>      >>
>      >> attached you find the offending test.fo <http://test.fo> (it was
>     generated from test.xml).
>      >>
>      >>>
>      >>> Thanks
>      >>>
>      >>> Mehdi
>      >>>
>      >>> On 21 July 2012 13:16, Wilhelm <wilhelm.meier@fh-kl.de
>     <ma...@fh-kl.de>
>      >>> <mailto:wilhelm.meier@fh-kl.de
>     <ma...@fh-kl.de>>> wrote:
>      >>>
>      >>>     Am 21.07.2012 13 <tel:21.07.2012%2013>
>     <tel:21.07.2012%2013>:47, schrieb
>      >>> rsargent@xmission.com <ma...@xmission.com>
>     <mailto:rsargent@xmission.com <ma...@xmission.com>>:
>      >>>
>      >>>
>      >>>         Show the stack trace.
>      >>>
>      >>>
>      >>>     start of the next element list is: page=112 col=0
>      >>>     Exception
>      >>>     org.apache.fop.apps.__FOPException
>      >>>     java.lang.NullPointerException
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.cli.__InputHandler.transformTo(__InputHandler.java:302)
>      >>>              at
>      >>>
>     org.apache.fop.cli.__InputHandler.renderTo(__InputHandler.java:130)
>      >>>              at org.apache.fop.cli.Main.__startFOP(Main.java:174)
>      >>>              at org.apache.fop.cli.Main.main(__Main.java:205)
>      >>>     Caused by: java.lang.NullPointerException
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.__InlineStackingLayoutManager.__getChangedKnuthElements(__InlineStackingLayoutManager.__java:376)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.InlineLayoutManager.__getChangedKnuthElements(__InlineLayoutManager.java:537)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.__InlineStackingLayoutManager.__getChangedKnuthElements(__InlineStackingLayoutManager.__java:368)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.InlineLayoutManager.__getChangedKnuthElements(__InlineLayoutManager.java:537)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__processUpdates(__LineLayoutManager.java:1349)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__findHyphenationPoints(__LineLayoutManager.java:1318)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__findOptimalBreakingPoints(__LineLayoutManager.java:797)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__createLineBreaks(__LineLayoutManager.java:763)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__getNextKnuthElements(__LineLayoutManager.java:592)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:571)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:552)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextKnuthElements(__BlockStackingLayoutManager.__java:280)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:123)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:115)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:571)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:552)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextKnuthElements(__BlockStackingLayoutManager.__java:280)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:123)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:115)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__getNextChildElements(__FlowLayoutManager.java:199)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__addChildElements(__FlowLayoutManager.java:140)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__addChildElements(__FlowLayoutManager.java:129)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__getNextKnuthElements(__FlowLayoutManager.java:70)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.__getNextKnuthElements(__PageBreaker.java:216)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__AbstractBreaker.__getNextBlockList(__AbstractBreaker.java:692)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.getNextBlockList(__PageBreaker.java:149)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.getNextBlockList(__PageBreaker.java:132)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__AbstractBreaker.doLayout(__AbstractBreaker.java:337)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.doLayout(__PageBreaker.java:85)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageSequenceLayoutManager.__activateLayout(__PageSequenceLayoutManager.__java:107)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.area.__AreaTreeHandler.__endPageSequence(__AreaTreeHandler.java:238)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.fo.pagination.__PageSequence.endOfNode(__PageSequence.java:120)
>      >>>              at org.apache.fop.fo <http://org.apache.fop.fo>
>      >>>
>      >>>
>     <http://org.apache.fop.fo>.__FOTreeBuilder$MainFOHandler.__endElement(FOTreeBuilder.java:__349)
>      >>>              at org.apache.fop.fo <http://org.apache.fop.fo>
>      >>>
>      >>>
>     <http://org.apache.fop.fo>.__FOTreeBuilder.endElement(__FOTreeBuilder.java:177)
>      >>>              at
>      >>>
>      >>>
>     org.apache.xalan.transformer.__TransformerIdentityImpl.__endElement(__TransformerIdentityImpl.java:__1102)
>      >>>              at
>      >>>
>     org.apache.xerces.parsers.__AbstractSAXParser.endElement(__Unknown
>      >>>     Source)
>      >>>              at
>      >>>
>     org.apache.xerces.xinclude.__XIncludeHandler.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.xerces.jaxp.__SAXParserImpl$JAXPSAXParser.__parse(Unknown
>      >>>     Source)
>      >>>              at
>      >>>
>      >>>
>     org.apache.xalan.transformer.__TransformerIdentityImpl.__transform(__TransformerIdentityImpl.java:__485)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.cli.__InputHandler.transformTo(__InputHandler.java:299)
>      >>>
>      >>>              ... 3 more
>      >>>
>      >>>     ---------
>      >>>
>      >>>     java.lang.NullPointerException
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.__InlineStackingLayoutManager.__getChangedKnuthElements(__InlineStackingLayoutManager.__java:376)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.InlineLayoutManager.__getChangedKnuthElements(__InlineLayoutManager.java:537)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.__InlineStackingLayoutManager.__getChangedKnuthElements(__InlineStackingLayoutManager.__java:368)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.InlineLayoutManager.__getChangedKnuthElements(__InlineLayoutManager.java:537)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__processUpdates(__LineLayoutManager.java:1349)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__findHyphenationPoints(__LineLayoutManager.java:1318)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__findOptimalBreakingPoints(__LineLayoutManager.java:797)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__createLineBreaks(__LineLayoutManager.java:763)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__inline.LineLayoutManager.__getNextKnuthElements(__LineLayoutManager.java:592)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:571)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:552)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextKnuthElements(__BlockStackingLayoutManager.__java:280)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:123)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:115)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:571)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:552)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextKnuthElements(__BlockStackingLayoutManager.__java:280)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:123)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:115)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__getNextChildElements(__FlowLayoutManager.java:199)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__addChildElements(__FlowLayoutManager.java:140)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__addChildElements(__FlowLayoutManager.java:129)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__FlowLayoutManager.__getNextKnuthElements(__FlowLayoutManager.java:70)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.__getNextKnuthElements(__PageBreaker.java:216)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__AbstractBreaker.__getNextBlockList(__AbstractBreaker.java:692)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.getNextBlockList(__PageBreaker.java:149)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.getNextBlockList(__PageBreaker.java:132)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__AbstractBreaker.doLayout(__AbstractBreaker.java:337)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageBreaker.doLayout(__PageBreaker.java:85)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.layoutmgr.__PageSequenceLayoutManager.__activateLayout(__PageSequenceLayoutManager.__java:107)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.area.__AreaTreeHandler.__endPageSequence(__AreaTreeHandler.java:238)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.fo.pagination.__PageSequence.endOfNode(__PageSequence.java:120)
>      >>>              at org.apache.fop.fo <http://org.apache.fop.fo>
>      >>>
>      >>>
>     <http://org.apache.fop.fo>.__FOTreeBuilder$MainFOHandler.__endElement(FOTreeBuilder.java:__349)
>      >>>              at org.apache.fop.fo <http://org.apache.fop.fo>
>      >>>
>      >>>
>     <http://org.apache.fop.fo>.__FOTreeBuilder.endElement(__FOTreeBuilder.java:177)
>      >>>              at
>      >>>
>      >>>
>     org.apache.xalan.transformer.__TransformerIdentityImpl.__endElement(__TransformerIdentityImpl.java:__1102)
>      >>>              at
>      >>>
>     org.apache.xerces.parsers.__AbstractSAXParser.endElement(__Unknown
>      >>>     Source)
>      >>>              at
>      >>>
>     org.apache.xerces.xinclude.__XIncludeHandler.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.xerces.jaxp.__SAXParserImpl$JAXPSAXParser.__parse(Unknown
>      >>>     Source)
>      >>>              at
>      >>>
>      >>>
>     org.apache.xalan.transformer.__TransformerIdentityImpl.__transform(__TransformerIdentityImpl.java:__485)
>      >>>              at
>      >>>
>      >>>
>     org.apache.fop.cli.__InputHandler.transformTo(__InputHandler.java:299)
>      >>>              at
>      >>>
>     org.apache.fop.cli.__InputHandler.renderTo(__InputHandler.java:130)
>      >>>              at org.apache.fop.cli.Main.__startFOP(Main.java:174)
>      >>>              at org.apache.fop.cli.Main.main(__Main.java:205)
>      >>>
>      >>>
>      >>>
>      >>>
>      >>>         Quoting Wilhelm <wilhelm.meier@fh-kl.de
>     <ma...@fh-kl.de>
>      >>>         <mailto:wilhelm.meier@fh-kl.de
>     <ma...@fh-kl.de>>>:
>      >>>
>      >>>
>      >>>             Hi,
>      >>>
>      >>>             using fop-1.0 oder fop-1.1rc1 I get
>     NullPointerExceptions if
>      >>>             I enable
>      >>>             hyphenation (language=de).
>      >>>
>      >>>             Any hints?
>
>     --
>     pascal
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>     <ma...@xmlgraphics.apache.org>
>     For additional commands, e-mail:
>     fop-users-help@xmlgraphics.apache.org
>     <ma...@xmlgraphics.apache.org>
>
>


-- 
Wilhelm


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org