Uploaded image for project: 'Publishing'
  1. Publishing
  2. PUBLISHING-75

Add runtime dependency to SAX library to magnolia-core to prevent OOM error during export or publishing of larger binaries from DAM

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Obsolete
    • Icon: Critical Critical
    • None
    • None
    • Magnolia 6.1.4
      Java 11 and Java 13
    • Yes

      In a relaunch project for our client ZEG we encountered the problems described in MAGNOLIA-7702 and PUBLISHING-69.

      We tracked it down to line 453 in org.apache.jackrabbit.commons.xml.Exporter:
      handler.endElement(uri, local, getXMLName(uri, local));
      when handling the attribute 'data' of type org.apache.jackrabbit.core.value.BinaryValueImpl causes an infinite loop.

      'handler' is of type info.magnolia.importexport.filters.NamespaceFilter
      and its member variable 'contentHandler' of type com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl
      which is set in info.magnolia.importexport.command.JcrExportCommand.Format#getContentHandler

      The class com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl is from the internal Java 11/13 java.xml module.

      By adding a maven dependency to xalan to our webapp module, an instance of org.apache.xalan.transformer.TransformerIdentityImpl
      is assigned in the getContentHandler method. With this change we were able to publish and export PDF files (up to 70MB) from DAM, which caused problems before.

      Because xalan is quite old and compiled with Java 1.3, we also tried Saxon-HE which also works fine, but seems to use more CPU and memory resources.

      <dependency>
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
      <version>2.7.2</version>
      <scope>runtime</scope>
      </dependency>

      or

      <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
      <version>9.9.1-6</version>
      <scope>runtime</scope>
      </dependency>

       

        Acceptance criteria

              rhayoun Rabie Hayoun
              chrismenzel Christian Menzel
              Nucleus
              Votes:
              8 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 0.75d
                    0.75d