Fop
  1. Fop
  2. FOP-1189

NullPointerException when redering .fo file in TableLayoutManager.initialize

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.92
    • Fix Version/s: None
    • Component/s: pdf
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      39608

      Description

      Hi,
      When trying to render the attached file I get the following exception using
      fop.0.92beta.

      Thanks,
      Michael

      <html><body>XSL-FO Processor Error(s) occured:<br><pre>2006-maj-18 14:21:37
      org.apache.fop.cli.Main startFOP<BR>
      ALLVARLIG: Exception<BR>
      java.lang.NullPointerException<BR>
      at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:167)<BR>
      at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114)<BR>
      at org.apache.fop.cli.Main.startFOP(Main.java:159)<BR>
      at org.apache.fop.cli.Main.main(Main.java:190)<BR>

      ---------
      <BR>
      java.lang.NullPointerException<BR>
      at org.apache.fop.layoutmgr.table.TableLayoutManager.initialize
      (TableLayoutManager.java:108)<BR>
      at org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM
      (AbstractLayoutManager.java:109)<BR>
      at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
      (BlockStackingLayoutManager.java:258)<BR>
      at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements
      (BlockLayoutManager.java:105)<BR>
      at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements
      (FlowLayoutManager.java:98)<BR>
      at
      org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthEleme
      nts(PageSequenceLayoutManager.java:234)<BR>
      at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList
      (AbstractBreaker.java:502)<BR>
      at
      org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList
      (PageSequenceLayoutManager.java:226)<BR>
      at org.apache.fop.layoutmgr.AbstractBreaker.doLayout
      (AbstractBreaker.java:252)<BR>
      at org.apache.fop.layoutmgr.AbstractBreaker.doLayout
      (AbstractBreaker.java:220)<BR>
      at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout
      (PageSequenceLayoutManager.java:152)<BR>
      at org.apache.fop.area.AreaTreeHandler.endPageSequence
      (AreaTreeHandler.java:320)<BR>
      at org.apache.fop.fo.pagination.PageSequence.endOfNode
      (PageSequence.java:147)<BR>
      at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement
      (FOTreeBuilder.java:357)<BR>
      at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:193)<BR>
      at org.apache.xalan.transformer.TransformerIdentityImpl.endElement
      (TransformerIdentityImpl.java:1101)<BR>
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      <BR>
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
      Source)<BR>
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.
      dispatch(Unknown Source)<BR>
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
      (Unknown Source)<BR>
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)<BR>
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)<BR>
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)<BR>
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)<BR>
      at org.apache.xalan.transformer.TransformerIdentityImpl.transform
      (TransformerIdentityImpl.java:484)<BR>
      at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:164)<BR>
      at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114)<BR>
      at org.apache.fop.cli.Main.startFOP(Main.java:159)<BR>
      at org.apache.fop.cli.Main.main(Main.java:190)<BR>

      1. fullmakt.fo
        23 kB
        Michael Forsberg

        Activity

        Michael Forsberg created issue -
        Hide
        Michael Forsberg added a comment -

        Attachment fullmakt.fo has been added with description: Letter rendered using fop0.92beta

        Show
        Michael Forsberg added a comment - Attachment fullmakt.fo has been added with description: Letter rendered using fop0.92beta
        Hide
        Jeremias Maerki added a comment -

        The reason for the NullPointerException is your omitting the length unit. I went
        into the spec and it suggests that the unit is optional but I didn't find any
        hint what unit to use in case it's not specified. So the work-around for now is
        to specify "0pt" instead of "0" for the border-spacing property. The NPE is
        certainly not nice so we need to do something.

        What happens is the the value "0" is internally represented by a NumberProperty
        which does not override Property's getLength() method which returns null. The
        interesting thing is that specifying padding="0" doesn't produce such an error,
        but then the values are represented as CondLengthProperty. Ideas, anyone?

        http://www.w3.org/TR/xsl11/#numbers

        Show
        Jeremias Maerki added a comment - The reason for the NullPointerException is your omitting the length unit. I went into the spec and it suggests that the unit is optional but I didn't find any hint what unit to use in case it's not specified. So the work-around for now is to specify "0pt" instead of "0" for the border-spacing property. The NPE is certainly not nice so we need to do something. What happens is the the value "0" is internally represented by a NumberProperty which does not override Property's getLength() method which returns null. The interesting thing is that specifying padding="0" doesn't produce such an error, but then the values are represented as CondLengthProperty. Ideas, anyone? http://www.w3.org/TR/xsl11/#numbers
        Hide
        Max Berger added a comment -

        Here are my 2cts

        • If a length is 0 it shouldn't matter which dimension it is.
        • Most parts of the XSL-Fo spec try to mimic the common xhtml and css standards. In these the default
          for non-unit measurements is pixels. I'd therefore recommed using pixels if nothing is specified, and
          output a warning, something like "measurement given without unit, pixels assumed".
        • i don't know if fop already specifies pixels, if not, they could be 1/72" (5.9.13.1)
        Show
        Max Berger added a comment - Here are my 2cts If a length is 0 it shouldn't matter which dimension it is. Most parts of the XSL-Fo spec try to mimic the common xhtml and css standards. In these the default for non-unit measurements is pixels. I'd therefore recommed using pixels if nothing is specified, and output a warning, something like "measurement given without unit, pixels assumed". i don't know if fop already specifies pixels, if not, they could be 1/72" (5.9.13.1)
        Hide
        Jeremias Maerki added a comment -
        Show
        Jeremias Maerki added a comment - Should be fixed now: http://svn.apache.org/viewvc?rev=420824&view=rev
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Michael Forsberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development