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

XSLFO with SVG and ConserverMemory flag generates Serialisation exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: fo/page
    • Labels:
      None

      Description

      OK, we have some very large XSL FO and have to use the conserve memory flag with FOP to allow our XSLFO to generate PDF / AFP files from these large inputs. When we include some SVG within the XSLFO (to generate some charts) the serialisation which happens during the page generation process causes an exception as it tries to serialise the SVG which ultimately causes some classes within the batik-anim dependent module to generate the following exception:

      java.io.NotSerializableException: org.apache.batik.anim.dom.SVGOMAnimatedString
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)

      To fix it I patched our local batik-anim jar to add Serialisation to AnimatedAttributeListener.java, AnimatedLiveAttributeValue.java I change the SVGOMDocument class member variable parsedURL be transient (otherwise it was also causing a serialisation exception).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jeromeof Jerome O'Flaherty
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: