diff --git a/core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java b/core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java index a2d8816ae5..dc46354b0f 100644 --- a/core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java +++ b/core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java @@ -14,10 +14,9 @@ import javax.script.Bindings; import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; import javax.script.ScriptException; -import org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory; - public class ScriptEvaluator { private static ScriptEngine engine; @@ -47,7 +46,7 @@ public static Boolean evalBool(String script, Object input) throws ScriptExcepti */ public static Object eval(String script, Object input) throws ScriptException { if (engine == null) { - engine = new NashornScriptEngineFactory().getScriptEngine(); + engine = new ScriptEngineManager().getEngineByName("Nashorn"); } if (engine == null) { throw new RuntimeException( diff --git a/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/def/tasks/Javascript.java b/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/def/tasks/Javascript.java index 0c88bf7614..cca0246f70 100644 --- a/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/def/tasks/Javascript.java +++ b/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/def/tasks/Javascript.java @@ -19,9 +19,9 @@ import javax.script.Bindings; import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; import javax.script.ScriptException; -import org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -100,7 +100,7 @@ public String getExpression() { * @return */ public Javascript validate() { - ScriptEngine scriptEngine = new NashornScriptEngineFactory().getScriptEngine(); + ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("Nashorn"); if (scriptEngine == null) { LOGGER.error("missing " + ENGINE + " engine. Ensure you are running supported JVM"); return this; @@ -128,7 +128,7 @@ public Javascript validate() { */ public Object test(Map input) { - ScriptEngine scriptEngine = new NashornScriptEngineFactory().getScriptEngine(); + ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("Nashorn"); if (scriptEngine == null) { LOGGER.error("missing " + ENGINE + " engine. Ensure you are running supported JVM"); return this; diff --git a/server/src/main/resources/log4j2.xml b/server/src/main/resources/log4j2.xml index 4cf6e9591b..cab346657d 100644 --- a/server/src/main/resources/log4j2.xml +++ b/server/src/main/resources/log4j2.xml @@ -21,15 +21,11 @@ - - - -