{"record":{"id":"d3d3d07eeecd078c","repo":"flowable/flowable-engine","slug":"couldn-t-initialize-cmmn-engine-from-spring-config","errorCode":null,"errorMessage":"couldn't initialize cmmn engine from spring configuration resource {resource}: {errorMessage}","messagePattern":"couldn't initialize cmmn engine from spring configuration resource (.+?): (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngines.java","lineNumber":106,"sourceCode":"            setInitialized(true);\n        } else {\n            LOGGER.info(\"Cmmn engines already initialized\");\n        }\n    }\n\n    protected static void initCmmnEngineFromSpringResource(URL resource) {\n        try {\n            Class<?> springConfigurationHelperClass = ReflectUtil.loadClass(\"org.flowable.cmmn.spring.SpringCmmnConfigurationHelper\");\n            Method method = springConfigurationHelperClass.getDeclaredMethod(\"buildCmmnEngine\", new Class<?>[] { URL.class });\n            CmmnEngine cmmnEngine = (CmmnEngine) method.invoke(null, new Object[] { resource });\n\n            String cmmnEngineName = cmmnEngine.getName();\n            EngineInfo cmmnEngineInfo = new EngineInfo(cmmnEngineName, resource.toString(), null);\n            cmmnEngineInfosByName.put(cmmnEngineName, cmmnEngineInfo);\n            cmmnEngineInfosByResourceUrl.put(resource.toString(), cmmnEngineInfo);\n\n        } catch (Exception e) {\n            throw new FlowableException(\"couldn't initialize cmmn engine from spring configuration resource \" + resource + \": \" + e.getMessage(), e);\n        }\n    }\n\n    /**\n     * Registers the given cmmn engine. No {@link EngineInfo} will be available for this cmmn engine. An engine that is registered will be closed when the {@link CmmnEngines#destroy()} is called.\n     */\n    public static void registerCmmnEngine(CmmnEngine cmmnEngine) {\n        cmmnEngines.put(cmmnEngine.getName(), cmmnEngine);\n    }\n\n    /**\n     * Unregisters the given cmmn engine.\n     */\n    public static void unregister(CmmnEngine cmmnEngine) {\n        cmmnEngines.remove(cmmnEngine.getName());\n    }\n\n    private static EngineInfo initCmmnEngineFromResource(URL resourceUrl) {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngines.java#L88-L124","documentation":"Thrown by CmmnEngines.initCmmnEngineFromSpringResource when building a Cmmn engine from a flowable-cmmn-context.xml Spring resource fails with any Exception. The original message is embedded so developers can see the underlying Spring/bean failure.","triggerScenarios":"The Spring XML referenced by the classpath resource cannot be parsed or its beans cannot be created — e.g. missing bean definitions, missing JDBC driver, invalid datasource properties, class-not-found for referenced classes — any exception during initCmmnEngineFromSpringResource.","commonSituations":"flowable-cmmn-context.xml with wrong datasource credentials; missing dependency jars so bean classes aren't found; duplicate engine names from two config files; malformed XML after manual edits; schema version mismatch after a Flowable upgrade.","solutions":["Read the embedded {errorMessage}/root cause to identify the failing bean or property","Fix the Spring XML: validate syntax, bean classes, and datasource/database settings","Ensure all required dependencies (jdbc driver, flowable-spring) are on the classpath","Give each flowable-cmmn-context.xml a unique engine name to avoid duplicate-name conflicts","Alternatively configure programmatically with CmmnEngineConfiguration to avoid Spring XML entirely"],"exampleFix":"// before (flowable-cmmn-context.xml)\n<property name=\"jdbcUrl\" value=\"jdbc:mysql://localhost:3306/flowale\" />\n\n// after (typo fixed + driver present)\n<property name=\"jdbcUrl\" value=\"jdbc:mysql://localhost:3306/flowable\" />","handlingStrategy":"try-catch","validationCode":"// Validate the Spring resource and required beans before engine init:\ntry (var ctx = new ClassPathXmlApplicationContext(\"flowable-cmmn-context.xml\")) {\n    ctx.getBean(CmmnEngineConfiguration.class);\n}","typeGuard":null,"tryCatchPattern":"try {\n    CmmnEngines.init();\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"couldn't initialize cmmn engine from spring configuration resource\")) {\n        // inspect e.getCause() for the underlying Spring failure\n        Throwable cause = e.getCause();\n    } else { throw e; }\n}","preventionTips":["Always inspect the wrapped cause (e.getCause()) for the real failure","Validate datasource URL/credentials and JDBC driver availability before boot","Give each Spring config file a unique engine name","Lint/validate Spring XML in CI and pin schema versions across upgrades"],"tags":["cmmn","spring","initialization","configuration"],"backgroundTag":"module-init-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}