Jerome O'Flaherty created FOP-2599:
--------------------------------------

             Summary: XSLFO with SVG and ConserverMemory flag generates 
Serialisation exception
                 Key: FOP-2599
                 URL: https://issues.apache.org/jira/browse/FOP-2599
             Project: FOP
          Issue Type: Bug
          Components: fo/page
    Affects Versions: 2.1
            Reporter: Jerome O'Flaherty


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).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to