flowable/flowable-engine · error · FlowableException

Can't find scripting engine for '" + language + "'

Error message

Can't find scripting engine for '" + language + "'

What it means

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.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/JSR223FlowableScriptEngine.java:106

                        }

                        // 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 FlowableException("Can't find scripting engine for '" + language + "'");
        }
        return scriptEngine;
    }

    public void setScriptEngineFactories(List<ScriptEngineFactory> scriptEngineFactories) {
        if (scriptEngineFactories != null) {
            for (ScriptEngineFactory scriptEngineFactory : scriptEngineFactories) {
                scriptEngineManager.registerEngineName(scriptEngineFactory.getEngineName(), scriptEngineFactory);
            }
        }
    }

    public void addScriptEngineFactory(ScriptEngineFactory scriptEngineFactory) {
        scriptEngineManager.registerEngineName(scriptEngineFactory.getEngineName(), scriptEngineFactory);
    }

    public void setCacheScriptingEngines(boolean cacheScriptingEngines) {
        this.cacheScriptingEngines = cacheScriptingEngines;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. 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+).
  2. Fix the language name in the BPMN scriptTask / ScriptEvaluationRequest to exactly match an engine-registered name (e.g. 'javascript' vs 'ecmascript').
  3. Verify engine discovery with new ScriptEngineManager().getEngineFactories() at startup and log the available names.
  4. If using a shaded/fat jar, ensure META-INF/services entries for javax.script.ScriptEngineFactory are not filtered by the shade/minimize config.

Example fix

// before (JDK 15+, Nashorn removed)
<flowable:script language="javascript">...</flowable:script>

// after: add nashorn-core to classpath
<dependency>
  <groupId>org.openjdk.nashorn</groupId>
  <artifactId>nashorn-core</artifactId>
  <version>15.4</version>
</dependency>
Defensive patterns

Strategy: validation

Validate before calling

javax.script.ScriptEngine engine = new javax.script.ScriptEngineManager().getEngineByName(language);
if (engine == null) {
    throw new IllegalStateException("No JSR-223 engine for '" + language + "'; available: " +
        new javax.script.ScriptEngineManager().getEngineFactories());
}

Try / catch

try {
    scriptResult = evaluateScript(request);
} catch (FlowableException e) {
    if (e.getMessage().startsWith("Can't find scripting engine")) {
        log.error("Scripting engine '{}' missing on classpath", language, e);
    }
    throw e;
}

Prevention

When it happens

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

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

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/cf5e8b444598bfc5. Report an issue: GitHub.