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

Serialisation issues when accessibility enabled and conserve-memory enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1, 2.2
    • None
    • renderer/afp, renderer/pdf
    • None
    • Important

    Description

      When rendering PDF or AFP using the conserve-memory and accessibility flag "on" a serialisation error is thrown.

      I'm using the "representation of document in intermediate format XML" and get the following error when the CachedRenderPagesModel.java class is trying to save the page to disk.

      SEVERE: Error while serializing page 1. Reason: java.io.NotSerializableException: org.apache.fop.render.intermediate.IFStructureTreeBuilder$IFStructureTreeElement
      java.io.NotSerializableException: org.apache.fop.render.intermediate.IFStructureTreeBuilder$IFStructureTreeElement
      

      It then leads to a NullPointerException when later the process tries to retrieve the page.

      I saw the same behaviour when the output is set as "pdf" and uses the PDFStructElem.java object even though that's not the mode I'm using that also needs to be fixed.

      SEVERE: Error while serializing page 1. Reason: java.io.NotSerializableException: org.apache.fop.pdf.PDFStructElem$Placeholder
      java.io.NotSerializableException: org.apache.fop.pdf.PDFStructElem$Placeholder
      

      I'm using fop within a java application but I reproduced using fop binaries:

      • name.xml - comes from the fop website
      • name2fo.xsl - comes from the fop website
        A page citation reference has been added to force the conserve-memory flag to serialise the page to disk for unresolved references.
      • cfg-accessibility.xml - comes from the fop website
        2 renderer have been added, PDF and AFP, since that's the ones I'm using.
        The <accessibility>true</accessibility> flag has been turned on

      fop -xml name.xml -xsl name2fo.xsl -c cfg-accessibility.xml out.pdf -conserve

      Attachments

        1. cfg-accessibility.xml
          2 kB
          Vincent Bonnefoy
        2. name.xml
          0.0 kB
          Vincent Bonnefoy
        3. name2fo.xsl
          0.8 kB
          Vincent Bonnefoy
        4. stacktrace-intermediate-fo-afp.txt
          20 kB
          Vincent Bonnefoy
        5. stacktrace-intermediate-fo-pdf.txt
          20 kB
          Vincent Bonnefoy
        6. stacktrace-pdf.txt
          19 kB
          Vincent Bonnefoy

        Activity

          People

            ssteiner Simon Steiner
            bvincent Vincent Bonnefoy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: