one of our integration tests at translate5 did run today in a
problem with okapi, that happens when converting an xml file with
an xpath in the ITS xml filter.
The following error was thrown by okapi
javax.xml.transform.TransformerException: JAXP0801002: the
compiler encountered an XPath expression containing '101'
operators that exceeds the '100' limit set by
The cause is what is for example documented in the
but seems to be true for updates for other java versions too (we
are using OpenJDK 11 on our server, but have the same issue)
CHAPTER 4. KNOWN ISSUES
OpenJDK 8 might include known issues. Solutions might exist for some of these known issues.
OpenJDK 8 specifies new default limits for XPath expressions. If you find that your code is exceeding
these limits, you can raise them by passing the following parameters to your OpenJDK deployment or by
setting the JAVA_TOOL_OPTIONS environment variable to use them:
-Djdk.xml.xpathExprGrpLimit, which defaults to 10
-Djdk.xml.xpathExprOpLimit, which defaults to 100
-Djdk.xml.xpathTotalOpLimit, which defaults to 10,000
These default limits restrict the number of expression groups, the number of operators in a single
expression, and the total number of operators.
So if you run in this issue: For Rainbow: Change the rainbow.sh as follows:
java -cp "`dirname $0`/lib/*" -Djdk.xml.xpathExprOpLimit=200 net.sf.okapi.applications.rainbow.Main "$@"
And for Longhorn users with Tomcat: Add a setenv.sh script to the bin directory of your tomcat with the following contents:
This solves the problem.
Perhaps it would be good, if this would be solved in the okapi source code itself somehow, so that not the users have to do the setting?