{"record":{"id":"5432dce942e924a0","repo":"flowable/flowable-engine","slug":"cmmn-engine-has-not-been-initialized","errorCode":null,"errorMessage":"CMMN engine has not been initialized","messagePattern":"CMMN engine has not been initialized","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/cmmn/CmmnEngineServicesAutoConfiguration.java","lineNumber":75,"sourceCode":"    /**\n     * If a process engine is present and no app engine that means that the CmmnEngine was created as part of the process engine.\n     * Therefore extract it from the CmmnEngines.\n     */\n    @Configuration(proxyBeanMethods = false)\n    @ConditionalOnMissingBean(type = {\n        \"org.flowable.cmmn.engine.CmmnEngine\",\n        \"org.flowable.app.engine.AppEngine\"\n    })\n    @ConditionalOnBean(type = {\n        \"org.flowable.engine.ProcessEngine\"\n    })\n    static class AlreadyInitializedEngineConfiguration {\n\n        @Bean\n        public CmmnEngine cmmnEngine(@SuppressWarnings(\"unused\") ProcessEngine processEngine) {\n            // The process engine needs to be injected, as otherwise it won't be initialized, which means that the CmmnEngine is not initialized yet\n            if (!CmmnEngines.isInitialized()) {\n                throw new IllegalStateException(\"CMMN engine has not been initialized\");\n            }\n            return CmmnEngines.getDefaultCmmnEngine();\n        }\n    }\n    \n    /**\n     * If an app engine is present that means that the CmmnEngine was created as part of the app engine.\n     * Therefore extract it from the CmmnEngines.\n     */\n    @Configuration(proxyBeanMethods = false)\n    @ConditionalOnMissingBean(type = {\n        \"org.flowable.cmmn.engine.CmmnEngine\"\n    })\n    @ConditionalOnBean(type = {\n        \"org.flowable.app.engine.AppEngine\"\n    })\n    static class AlreadyInitializedAppEngineConfiguration {\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/cmmn/CmmnEngineServicesAutoConfiguration.java#L57-L93","documentation":"In CmmnEngineServicesAutoConfiguration.AlreadyInitializedEngineConfiguration, the cmmnEngine @Bean only re-exposes the already-created default CMMN engine; it assumes the injected ProcessEngine initialization created it. If CmmnEngines.isInitialized() is false, no CMMN engine was built, and Flowable throws IllegalStateException 'CMMN engine has not been initialized'. This fails fast rather than returning a null engine.","triggerScenarios":"Spring context where CmmnEngineServicesAutoConfiguration is activated but the CMMN engine was never initialized — e.g. process engine created without CMMN engine support, or cmmn engine auto-configuration/factory bean excluded or failed earlier.","commonSituations":"Classpath includes CMMN services auto-configuration but flowable-cmmn-engine/starter is missing or misconfigured; custom configuration builds ProcessEngine without cmmnEngineConfiguration; earlier CMMN init failure (DB schema) silently aborting; excluding CmmnEngineAutoConfiguration while keeping services auto-config.","solutions":["Add/verify flowable-spring-boot-starter-cmmn (or flowable-cmmn-engine) dependency so the CMMN engine actually initializes","Do not exclude CmmnEngineAutoConfiguration; ensure the process engine configuration includes the CMMN engine","Inspect startup logs for an earlier CMMN engine creation failure (datasource/schema issues)","Enable flowable.cmmn.enabled=true and confirm CmmnEngine beans are defined"],"exampleFix":"// before (pom.xml) - process engine only\n<dependency>flowable-spring-boot-starter-process</dependency>\n// after\n<dependency>flowable-spring-boot-starter-process</dependency>\n<dependency>flowable-spring-boot-starter-cmmn</dependency>","handlingStrategy":"try-catch","validationCode":"if (!CmmnEngines.isInitialized()) {\n    throw new IllegalStateException(\"CMMN engine missing: add flowable-spring-boot-starter-cmmn and keep auto-configuration enabled\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    CmmnEngine engine = CmmnEngines.getDefaultCmmnEngine();\n} catch (IllegalStateException e) {\n    logger.error(\"CMMN engine not initialized: check cmmn starter dependency and earlier init failures\", e);\n    throw e;\n}","preventionTips":["Include flowable-spring-boot-starter-cmmn whenever CMMN services are used","Never exclude CmmnEngineAutoConfiguration while depending on CMMN services","Monitor startup logs for DB/schema failures that abort engine initialization"],"tags":["spring-boot","flowable","cmmn","initialization","lifecycle"],"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-14T05:17:10.506Z"}