KB Article #178623

Fastest scripting language is not being used - Script must be edited to conform with Nashorn syntax

Problem

When upgrading from an older version, there is a warning to switch from the Rhino scripting engine to the Nashorn scripting engine and it is not clear why this is required. An error appears in the upgrade report similarly to the following:


REPORT 30/May/2017:17:55:47.572 [2044:000000000000000000000000] @UPGRADE(@LABEL(Fastest scripting language is not being used)@TYPE(JSENGINE_CHECK),@SEVERITY(WARNING),@DESC(Recommendation is to set Language option to JavaScript for filter 'Scripting Language Filter'. Script must be edited to conform with Nashorn syntax)@ESPK(/[CircuitContainer]name=ScriptPolicyContainer/[FilterCircuit]name=ScriptPolicy/[JavaScriptFilter]name=Scripting Language Filter))

Resolution

In Java 8, Oracle changed the scripting engine from the Rhino engine to the Nashorn scripting engine. When the API Gateway updated its JRE, Mozilla Rhino was no longer available within the language itself and support for it could only be obtained from an external Rhino JAR, which is significantly slower due to no longer being part of Java.


As such, we have a warning during upgrades to update affected JavaScript scripting language filters from Rhino syntax to Nashorn syntax. While a compatibility JAR exists to allow the scripts with the older syntax to run, there is a significant performance cost to doing this and conversion to Nashorn syntax is recommended and one of the many Nashorn migration guides should be consulted for how to adjust the scripts.