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

    Details

    • Type: Improvement
    • Status: Selected
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Environment:
      Magnolia 6.1.4
      Java 11 and Java 13
    • Patch included:
      Yes

      Description

      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>

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              chrismenzel Christian Menzel
              Votes:
              8 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response: