flowable/flowable-engine · error · org.activiti.engine.ActivitiException

Can't find scripting engine for

Error message

Can't find scripting engine for '${language}'

What it means

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.

Solutions

  1. Add the scripting engine dependency for the requested language to the classpath (e.g. org.codehaus.groovy:groovy-all for 'groovy').
  2. Correct the 'language' attribute in the BPMN/activiti:scriptElement to match a registered engine name exactly (lowercase, e.g. 'javascript', 'groovy').
  3. On JDK 15+, add the standalone Nashorn dependency (org.openjdk.nashorn:nashorn-core) if using 'javascript'.
  4. Verify with a ScriptEngineManager.getEngineFactories() diagnostic which engines are actually registered.

Example fix

// before (BPMN on JDK 15+)
<scriptTask scriptFormat="javascript">...
// after: add Nashorn to pom.xml
<dependency>
  <groupId>org.openjdk.nashorn</groupId>
  <artifactId>nashorn-core</artifactId>
  <version>15.4</version>
</dependency>
Defensive patterns

Strategy: validation

Validate before calling

ScriptEngineManager sem = new ScriptEngineManager();
if (sem.getEngineByName(language) == null) {
    throw new IllegalStateException("No JSR-223 engine registered for '" + language + "'; add its dependency to the classpath");
}

Try / catch

try {
    scriptingEngines.evaluateScript(...);
} catch (ActivitiException e) {
    if (e.getMessage().startsWith("Can't find scripting engine")) {
        // fall back to default engine or fail fast with actionable message
    }
}

Prevention

When it happens

Trigger: 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+).

Common situations: 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').

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/90625c77baaede7c. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/scripting/ScriptingEngines.java:124

                        } catch (Exception ignore) {
                            // ignore this, in case engine doesn't support the passed attribute
                        }
                    }

                    // Check if script-engine allows caching, using "THREADING" parameter as defined in spec
                    Object threadingParameter = scriptEngine.getFactory().getParameter("THREADING");
                    if (threadingParameter != null) {
                        // Add engine to cache as any non-null result from the threading-parameter indicates at least MT-access
                        cachedEngines.put(language, scriptEngine);
                    }
                }
            }
        } else {
            scriptEngine = scriptEngineManager.getEngineByName(language);
        }

        if (scriptEngine == null) {
            throw new ActivitiException("Can't find scripting engine for '" + language + "'");
        }
        return scriptEngine;
    }

    /**
     * override to build a spring aware ScriptingEngines
     */
    protected Bindings createBindings(VariableScope variableScope) {
        return scriptBindingsFactory.createBindings(variableScope);
    }

    /**
     * override to build a spring aware ScriptingEngines
     */
    protected Bindings createBindings(VariableScope variableScope, boolean storeScriptVariables) {
        return scriptBindingsFactory.createBindings(variableScope, storeScriptVariables);
    }

View on GitHub (pinned to d6d39ce1c6)