Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1
-
None
-
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).