Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-1549

Marker example (hide.fo) throws Null Pointer Exception for forward references

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 0.94
    • None
    • unqualified
    • None
    • Operating System: Windows XP
      Platform: PC
    • 45295

    Description

      In 0.94 and 0.95 beta the Marker example (hide.fo) throws the following Exception.

      C:\Program Files\fop-0.94\examples\fo>ant runtest
      Buildfile: build.xml

      init:

      newPDF:

      newTestFiles:
      [fop] C:\Program Files\fop-0.94\examples\fo\markers\hide.fo -> C:\Program
      Files\fop-0.94\examples\fo\tests\hide.pdf
      [fop] 27-Jun-2008 09:59:38 org.apache.fop.cli.InputHandler error
      [fop] SEVERE: javax.xml.transform.TransformerException:

      BUILD FAILED
      C:\Program Files\fop-0.94\examples\fo\build.xml:82: The following error occurred
      while executing this line:
      C:\Program Files\fop-0.94\examples\fo\build.xml:48: javax.xml.transform.Transfor
      merException: java.lang.NullPointerException:

      Total time: 2 seconds

      I have attached a sample file which more closely matches the use case that I discovered this issue from. This works fine in 0.25 but is broken in 0.94/0.95beta.

      The stack trace from running this example on 0.94 is slightly more useful than the one from the example:

      H:\My Documents\Catlin\IT\Development\FO Processor\run_fo>"C:\Program Files\fop-
      0.94\fop.bat" -fo infile.fo -pdf outfile.pdf
      27-Jun-2008 10:32:53 org.apache.fop.cli.Main startFOP
      SEVERE: 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.fo.flow.PageNumberCitation.startOfNode(PageNumberCitat
      ion.java:115)
      at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuil
      der.java:329)
      at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
      at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Tra
      nsformerIdentityImpl.java:1072)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour
      ce)
      at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unkn
      own Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn
      own 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)

      Attachments

        1. infile.fo
          2 kB
          Jamie Browning

        Activity

          People

            fop-dev@xmlgraphics.apache.org fop-dev
            jbrowning@catlin.com Jamie Browning
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: