{"record":{"id":"cf5e8b444598bfc5","repo":"flowable/flowable-engine","slug":"can-t-find-scripting-engine-for-language","errorCode":null,"errorMessage":"Can't find scripting engine for '\" + language + \"'","messagePattern":"Can't find scripting engine for '\" \\+ language \\+ \"'","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/JSR223FlowableScriptEngine.java","lineNumber":106,"sourceCode":"                        }\n\n                        // Check if script-engine allows caching, using \"THREADING\"\n                        // parameter as defined in spec\n                        Object threadingParameter = scriptEngine.getFactory().getParameter(\"THREADING\");\n                        if (threadingParameter != null) {\n                            // Add engine to cache as any non-null result from the\n                            // threading-parameter indicates at least MT-access\n                            cachedEngines.put(language, scriptEngine);\n                        }\n                    }\n                }\n            }\n        } else {\n            scriptEngine = scriptEngineManager.getEngineByName(language);\n        }\n\n        if (scriptEngine == null) {\n            throw new FlowableException(\"Can't find scripting engine for '\" + language + \"'\");\n        }\n        return scriptEngine;\n    }\n\n    public void setScriptEngineFactories(List<ScriptEngineFactory> scriptEngineFactories) {\n        if (scriptEngineFactories != null) {\n            for (ScriptEngineFactory scriptEngineFactory : scriptEngineFactories) {\n                scriptEngineManager.registerEngineName(scriptEngineFactory.getEngineName(), scriptEngineFactory);\n            }\n        }\n    }\n\n    public void addScriptEngineFactory(ScriptEngineFactory scriptEngineFactory) {\n        scriptEngineManager.registerEngineName(scriptEngineFactory.getEngineName(), scriptEngineFactory);\n    }\n\n    public void setCacheScriptingEngines(boolean cacheScriptingEngines) {\n        this.cacheScriptingEngines = cacheScriptingEngines;","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/JSR223FlowableScriptEngine.java#L88-L124","documentation":"JSR223FlowableScriptEngine.getEngineByName looks up a javax.script ScriptEngine by language name via the ScriptEngineManager; when no engine is registered for that name it throws this FlowableException. The JVM only discovers engines present on the classpath (e.g. Nashorn via jdk.scripting.nashorn, Groovy, Jython). Since Java 15 Nashorn was removed from the JDK, so 'javascript'/'js' silently resolves to null.","triggerScenarios":"Calling evaluate() (or any script task / script execution path) with a language string that has no JSR-223 engine on the classpath, or with a misspelled alias (e.g. 'js' vs 'javascript', 'groovy' with no groovy-jsr223 dependency).","commonSituations":"Upgrading to JDK 15+ where Nashorn was removed; missing groovy/groovy-jsr223 or jython/jruby dependencies in the app; script language attribute in BPMN XML not matching a registered engine name; shading the jar and dropping META-INF/services/javax.script.ScriptEngineFactory.","solutions":["Add the scripting engine dependency for the language (e.g. org.codehaus.groovy:groovy-jsr223, org.python:jython-standalone, or org.openjdk.nashorn:nashorn-core for JDK 15+).","Fix the language name in the BPMN scriptTask / ScriptEvaluationRequest to exactly match an engine-registered name (e.g. 'javascript' vs 'ecmascript').","Verify engine discovery with new ScriptEngineManager().getEngineFactories() at startup and log the available names.","If using a shaded/fat jar, ensure META-INF/services entries for javax.script.ScriptEngineFactory are not filtered by the shade/minimize config."],"exampleFix":"// before (JDK 15+, Nashorn removed)\n<flowable:script language=\"javascript\">...</flowable:script>\n\n// after: add nashorn-core to classpath\n<dependency>\n  <groupId>org.openjdk.nashorn</groupId>\n  <artifactId>nashorn-core</artifactId>\n  <version>15.4</version>\n</dependency>","handlingStrategy":"validation","validationCode":"javax.script.ScriptEngine engine = new javax.script.ScriptEngineManager().getEngineByName(language);\nif (engine == null) {\n    throw new IllegalStateException(\"No JSR-223 engine for '\" + language + \"'; available: \" +\n        new javax.script.ScriptEngineManager().getEngineFactories());\n}","typeGuard":null,"tryCatchPattern":"try {\n    scriptResult = evaluateScript(request);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Can't find scripting engine\")) {\n        log.error(\"Scripting engine '{}' missing on classpath\", language, e);\n    }\n    throw e;\n}","preventionTips":["Log available script engines at application startup as a health check.","Pin a scripting engine dependency (groovy-jsr223 or nashorn-core) explicitly in the build.","Keep the BPMN language attribute and engine names in a shared constant to avoid typos.","Test script tasks in CI on the same JDK version used in production."],"tags":["scripting","jsr223","missing-dependency","configuration"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}