{"record":{"id":"90625c77baaede7c","repo":"flowable/flowable-engine","slug":"can-t-find-scripting-engine-for-language-90625c","errorCode":null,"errorMessage":"Can't find scripting engine for '${language}'","messagePattern":"Can't find scripting engine for '(.+?)'","errorType":"exception","errorClass":"org.activiti.engine.ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/scripting/ScriptingEngines.java","lineNumber":124,"sourceCode":"                        } catch (Exception ignore) {\n                            // ignore this, in case engine doesn't support the passed attribute\n                        }\n                    }\n\n                    // Check if script-engine allows caching, using \"THREADING\" 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 threading-parameter indicates at least MT-access\n                        cachedEngines.put(language, scriptEngine);\n                    }\n                }\n            }\n        } else {\n            scriptEngine = scriptEngineManager.getEngineByName(language);\n        }\n\n        if (scriptEngine == null) {\n            throw new ActivitiException(\"Can't find scripting engine for '\" + language + \"'\");\n        }\n        return scriptEngine;\n    }\n\n    /**\n     * override to build a spring aware ScriptingEngines\n     */\n    protected Bindings createBindings(VariableScope variableScope) {\n        return scriptBindingsFactory.createBindings(variableScope);\n    }\n\n    /**\n     * override to build a spring aware ScriptingEngines\n     */\n    protected Bindings createBindings(VariableScope variableScope, boolean storeScriptVariables) {\n        return scriptBindingsFactory.createBindings(variableScope, storeScriptVariables);\n    }\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/scripting/ScriptingEngines.java#L106-L142","documentation":"ScriptingEngines.getEngineByName resolves a JSR-223 ScriptEngine for the given language name via the ScriptEngineManager. When no engine is registered for that language (or the name is misspelled/unavailable), it throws this ActivitiException. Flowable/Activiti script tasks and expressions rely on this lookup.","triggerScenarios":"Executing a script task or script expression whose 'language' attribute names a scripting language for which no JSR-223 engine is on the classpath (e.g. 'groovy' without groovy-all, 'jython' without jython jar, 'javascript' after Nashorn removal in JDK 15+).","commonSituations":"Upgrading the JDK past 14 where the built-in Nashorn JavaScript engine was removed; missing the scripting-engine dependency in the deployment; typo in the script language attribute ('javascipt', case mismatch like 'Groovy').","solutions":["Add the scripting engine dependency for the requested language to the classpath (e.g. org.codehaus.groovy:groovy-all for 'groovy').","Correct the 'language' attribute in the BPMN/activiti:scriptElement to match a registered engine name exactly (lowercase, e.g. 'javascript', 'groovy').","On JDK 15+, add the standalone Nashorn dependency (org.openjdk.nashorn:nashorn-core) if using 'javascript'.","Verify with a ScriptEngineManager.getEngineFactories() diagnostic which engines are actually registered."],"exampleFix":"// before (BPMN on JDK 15+)\n<scriptTask scriptFormat=\"javascript\">...\n// after: add Nashorn to pom.xml\n<dependency>\n  <groupId>org.openjdk.nashorn</groupId>\n  <artifactId>nashorn-core</artifactId>\n  <version>15.4</version>\n</dependency>","handlingStrategy":"validation","validationCode":"ScriptEngineManager sem = new ScriptEngineManager();\nif (sem.getEngineByName(language) == null) {\n    throw new IllegalStateException(\"No JSR-223 engine registered for '\" + language + \"'; add its dependency to the classpath\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    scriptingEngines.evaluateScript(...);\n} catch (ActivitiException e) {\n    if (e.getMessage().startsWith(\"Can't find scripting engine\")) {\n        // fall back to default engine or fail fast with actionable message\n    }\n}","preventionTips":["Keep the scripting engine dependency (groovy/jython/nashorn) in the same module that executes scripts","Pin the language attribute in BPMN to a lowercase, exact engine name","After JDK upgrades, re-verify the JavaScript engine (Nashorn was removed in JDK 15)","Log ScriptEngineManager.getEngineFactories() at startup as a sanity check"],"tags":["scripting","classloader","configuration","javascript"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}