[
https://issues.apache.org/jira/browse/FOP-3142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17750343#comment-17750343
]
Huy Ho commented on FOP-3142:
-----------------------------
Thanks for the explanation. Here's the java we are running.
> java -version
Picked up _JAVA_OPTIONS: -Djava.io.tmpdir="/tmp" -XX:-UsePerfData -Xms128M
-Xmx2048m -Xss3M
openjdk version "11.0.19" 2023-04-18 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-2) (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-2) (build 11.0.19+7-LTS, mixed
mode, sharing)
We have already tried adding the java definitions mentioned in the
stackoverflow link above to bypass the XPATH limit, however, it results in a
different error below. We initially thought it was a JDK issue and have
updated the JDK to the mentioned version, but that did not fix it either. The
only solution we have found to be working thus far is to drop in the xalan.jar
library.
{{{{Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/usr2/vdxfiles/vtmpgsql/rms/tmp
-XX:-UsePerfData -Xms2048m -Xmx2048m -Xss32m -Djdk.xml.xpathExprGrpLimit=0
-Djdk.xml.xpathExprOpLimit=0 -Djdk.xml.xpathTotalOpLimit=0
OpenJDK 64-Bit Server VM warning: Option AggressiveOpts was deprecated in
version 11.0 and will likely be removed in a future release.
FOP Version 2.8
ERROR: 'Could not compile stylesheet'
FATAL ERROR: 'Internal XSLTC error: a method in the translet exceeds the Java
Virtual Machine limitation on the length of a method of 64 kilobytes. This is
usually caused by templates in a stylesheet that are very large. Try
restructuring your stylesheet to use smaller templates.'
:Internal XSLTC error: a method in the translet exceeds the Java
Virtual Machine limitation on the length of a method of 64 kilobytes. This is
usually caused by templates in a stylesheet that are very large. Try
restructuring your stylesheet to use smaller templates.
[ERROR] FOP - Exception <org.apache.fop.apps.FOPException:
javax.xml.transform.TransformerConfigurationException: Internal XSLTC error: a
method in the translet exceeds the Java Virtual Machine limitation on the
length of a method of 64 kilobytes. This is usually caused by templates in a
stylesheet that are very large. Try restructuring your stylesheet to use
smaller templates.
javax.xml.transform.TransformerConfigurationException: Internal XSLTC error: a
method in the translet exceeds the Java Virtual Machine limitation on the
length of a method of 64 kilobytes. This is usually caused by templates in a
stylesheet that are very large. Try restructuring your stylesheet to use
smaller templates.>org.apache.fop.apps.FOPException:
javax.xml.transform.TransformerConfigurationException: Internal XSLTC error: a
method in the translet exceeds the Java Virtual Machine limitation on the
length of a method of 64 kilobytes. This is usually caused by templates in a
stylesheet that are very large. Try restructuring your stylesheet to use
smaller templates.
javax.xml.transform.TransformerConfigurationException: Internal XSLTC error: a
method in the translet exceeds the Java Virtual Machine limitation on the
length of a method of 64 kilobytes. This is usually caused by templates in a
stylesheet that are very large. Try restructuring your stylesheet to use
smaller templates.}}}}
> Fatal error when compiling large xsl templates
> ----------------------------------------------
>
> Key: FOP-3142
> URL: https://issues.apache.org/jira/browse/FOP-3142
> Project: FOP
> Issue Type: Bug
> Affects Versions: 2.8
> Reporter: Huy Ho
> Priority: Critical
>
> After we updated from FOP 2.6 to the latest FOP 2.8 version, our application
> is running into the following error when compiling our stylesheets (stack
> trace below). To get around this issue, we downloaded the latest xalan-j
> 2.7.3 library from [https://xalan.apache.org/xalan-j/index.html] and drop
> them in the fop/lib directory.
>
> {{java.lang.RuntimeException: XPATH_LIMIT}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parseTopLevel(Parser.java:1165)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parseExpression(Parser.java:1112)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.VariableBase.parseContents(VariableBase.java:250)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Param.parseContents(Param.java:106)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.parseOwnChildren(Stylesheet.java:587)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.parseContents(Stylesheet.java:559)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Import.parseContents(Import.java:132)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.parseOwnChildren(Stylesheet.java:597)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.parseContents(Stylesheet.java:559)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.createAST(Parser.java:398)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:496)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:576)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:1018)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:817)}}
> {{ at
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:274)}}
> {{ at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116)}}
> {{ at org.apache.fop.cli.Main.startFOP(Main.java:183)}}
> {{ at org.apache.fop.cli.Main.main(Main.java:214)}}
>
> {{ERROR: 'JAXP0801003: the compiler encountered XPath expressions with an
> accumulated '10,001' operators that exceeds the '10,000' limit set by
> 'FEATURE_SECURE_PROCESSING'.'}}
> {{FATAL ERROR: 'JAXP0801003: the compiler encountered XPath expressions with
> an accumulated '10,001' operators that exceeds the '10,000' limit set by
> 'FEATURE_SECURE_PROCESSING'.'}}
> {{[ERROR] FOP - Exception <org.apache.fop.apps.FOPException:
> javax.xml.transform.TransformerConfigurationException: JAXP0801003: the
> compiler encountered XPath expressions with an accumulated '10,001' operators
> that exceeds the '10,000' limit set by 'FEATURE_SECURE_PROCESSING'.}}
> {{javax.xml.transform.TransformerConfigurationException: JAXP0801003: the
> compiler encountered XPath expressions with an accumulated '10,001' operators
> that exceeds the '10,000' limit set by
> 'FEATURE_SECURE_PROCESSING'.>org.apache.fop.apps.FOPException:
> javax.xml.transform.TransformerConfigurationException: JAXP0801003: the
> compiler encountered XPath expressions with an accumulated '10,001' operators
> that exceeds the '10,000' limit set by 'FEATURE_SECURE_PROCESSING'.}}
> {{javax.xml.transform.TransformerConfigurationException: JAXP0801003: the
> compiler encountered XPath expressions with an accumulated '10,001' operators
> that exceeds the '10,000' limit set by 'FEATURE_SECURE_PROCESSING'.}}
> {{ at
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:296)}}
> {{ at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116)}}
> {{ at org.apache.fop.cli.Main.startFOP(Main.java:183)}}
> {{ at org.apache.fop.cli.Main.main(Main.java:214)}}
> {{Caused by: javax.xml.transform.TransformerConfigurationException:
> JAXP0801003: the compiler encountered XPath expressions with an accumulated
> '10,001' operators that exceeds the '10,000' limit set by
> 'FEATURE_SECURE_PROCESSING'.}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:1061)}}
> {{ at
> java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:817)}}
> {{ at
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:274)}}
> {{ ... 3 more}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)