After upgrading Symantec Identity Portal to version 14.x, legacy JavaScript handlers may fail during execution.
This failure is typically due to the underlying JVM upgrade to Java 1.8, which replaced the "Rhino" JavaScript engine with the "Nashorn" engine. Nashorn does not support legacy Rhino functions like importPackage() by default.
Identity Portal 14.x
In Java 1.8, the default JavaScript engine changed from Rhino to Nashorn. Nashorn is strictly compliant with the ECMAScript specification and does not automatically include the Mozilla-specific compatibility extensions (like importPackage or importClass) that were available in Rhino.
To restore legacy support for importPackage, add the following line to the very top of your JavaScript handler:
Instead of importing entire packages, it is a best practice to use Java.type to reference specific Java classes. This improves performance and script clarity.
Example - Legacy Rhino Syntax:
Example - Modern Nashorn Syntax: