{"record":{"id":"253c8ebdb7bc53ee","repo":"flowable/flowable-engine","slug":"problem-resolving-scripting-engine","errorCode":null,"errorMessage":"problem resolving scripting engine: ","messagePattern":"problem resolving scripting engine: ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-osgi/src/main/java/org/flowable/osgi/OsgiJSR223FlowableScriptEngine.java","lineNumber":32,"sourceCode":"\nimport javax.script.ScriptEngine;\n\nimport org.flowable.common.engine.api.FlowableException;\nimport org.flowable.common.engine.impl.scripting.JSR223FlowableScriptEngine;\nimport org.osgi.framework.InvalidSyntaxException;\n\n/**\n * @author Filip Hrisafov\n */\npublic class OsgiJSR223FlowableScriptEngine extends JSR223FlowableScriptEngine {\n\n    @Override\n    protected ScriptEngine getEngineByName(String language) {\n        ScriptEngine scriptEngine = null;\n        try {\n            scriptEngine = Extender.resolveScriptEngine(language);\n        } catch (InvalidSyntaxException e) {\n            throw new FlowableException(\"problem resolving scripting engine: \" + e.getMessage(), e);\n        }\n\n        if (scriptEngine == null) {\n            return super.getEngineByName(language);\n        }\n\n        return scriptEngine;\n    }\n}\n","sourceCodeStart":14,"sourceCodeEnd":42,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-osgi/src/main/java/org/flowable/osgi/OsgiJSR223FlowableScriptEngine.java#L14-L42","documentation":"OsgiJSR223FlowableScriptEngine.getEngineByName delegates script engine resolution to Extender.resolveScriptEngine, which can throw InvalidSyntaxException (from the OSGi LDAP filter/service tracker machinery). Flowable wraps it in a FlowableException('problem resolving scripting engine: <message>') so script task execution fails with a Flowable-specific exception. If resolution simply returns null, the superclass default lookup is used instead.","triggerScenarios":"Executing a script task (or otherwise requesting an engine by name) while the OSGi service tracker filter used by Extender.resolveScriptEngine is syntactically invalid, causing InvalidSyntaxException; typically due to a bad engine-name-derived filter or misconfigured scripting engine registration.","commonSituations":"Custom script engine names containing characters that break LDAP filter syntax; misconfigured script engine service registration in the OSGi container; requesting a scripting language before its engine bundle is registered.","solutions":["Check the chained cause (InvalidSyntaxException) for the exact invalid filter string","Fix the script engine name/registration so the derived OSGi filter is valid LDAP syntax","Ensure the script engine bundle is deployed and its factory is correctly registered","If the engine is intentionally unavailable, rely on the default lookup by using a standard language name (e.g. 'javascript', 'groovy')"],"exampleFix":"// before\n// engine registered with name \"my engine (v2)\" -> invalid LDAP filter chars\n// after\n// register the factory with a simple name\nfactory.getNames().add(\"myengine\"); // no parentheses/spaces","handlingStrategy":"try-catch","validationCode":"// validate the language name before requesting an engine\nif (language == null || language.matches(\".*[()&=!<>].*\")) {\n    throw new IllegalArgumentException(\"Script language name breaks OSGi filter syntax: \" + language);\n}","typeGuard":null,"tryCatchPattern":"try {\n    scriptEngine.eval(script, bindings);\n} catch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"problem resolving scripting engine\")) {\n        logger.warn(\"Falling back: cannot resolve script engine\", e);\n        // use default engine lookup or a supported language\n    } else {\n        throw e;\n    }\n}","preventionTips":["Use simple language names without LDAP filter metacharacters","Deploy and start script engine bundles before processes using them","Verify registered factory names by listing Extender-resolved engines in a smoke test"],"tags":["osgi","scripting","exception"],"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"}