{"record":{"id":"f6e2a35c877445da","repo":"flowable/flowable-engine","slug":"no-cmmnengine-class-getname-defined-in-t","errorCode":null,"errorMessage":"no \" + CmmnEngine.class.getName() + \" defined in the application context \" + resource","messagePattern":"no \" \\+ CmmnEngine\\.class\\.getName\\(\\) \\+ \" defined in the application context \" \\+ resource","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnConfigurationHelper.java","lineNumber":39,"sourceCode":"import org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.context.support.GenericXmlApplicationContext;\nimport org.springframework.core.io.UrlResource;\n\n/**\n * @author Tijs Rademakers\n */\npublic class SpringCmmnConfigurationHelper {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(SpringCmmnConfigurationHelper.class);\n\n    public static CmmnEngine buildCmmnEngine(URL resource) {\n        LOGGER.debug(\"==== BUILDING SPRING APPLICATION CONTEXT AND CMMN ENGINE =========================================\");\n\n        try (GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource))) {\n            Map<String, CmmnEngine> beansOfType = applicationContext.getBeansOfType(CmmnEngine.class);\n            if ((beansOfType == null) || beansOfType.isEmpty()) {\n                throw new FlowableException(\"no \" + CmmnEngine.class.getName() + \" defined in the application context \" + resource);\n            }\n\n            CmmnEngine cmmnEngine = beansOfType.values().iterator().next();\n\n            LOGGER.debug(\"==== SPRING CMMN ENGINE CREATED ==================================================================\");\n            return cmmnEngine;\n        }\n    }\n\n}\n","sourceCodeStart":21,"sourceCodeEnd":50,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnConfigurationHelper.java#L21-L50","documentation":"FlowableException thrown by SpringCmmnConfigurationHelper.buildCmmnEngine(URL) after loading a Spring XML application context from the given resource URL when no bean of type CmmnEngine exists in it. The helper expects the Spring config to define the engine as a bean so it can return it.","triggerScenarios":"Calling CmmnEngineConfiguration via a spring-config resource URL (e.g. flowable.cmmn.cfg.xml style Spring context) where the XML defines no <bean> implementing CmmnEngine, or defines it under the wrong type/interface.","commonSituations":"Spring XML missing the cmmnEngine bean; bean defined as the configuration class instead of the engine; bean factory returning null/empty map; wrong resource URL pointing to an unrelated context file.","solutions":["Define a bean of type CmmnEngine in the Spring XML (e.g. <bean id=\"cmmnEngine\" class=\"org.flowable.cmmn.engine.CmmnEngine\" factory-bean=... factory-method=\"buildCmmnEngine\"/>)","Point the URL at the correct application-context resource that actually contains the engine bean","Verify the bean's class/factory produces CmmnEngine (not just CmmnEngineConfiguration)","Check application logs for Spring context load errors preceding this exception"],"exampleFix":"// before (no engine bean in XML)\n<bean id=\"cmmnEngineConfiguration\" class=\"org.flowable.cmmn.spring.SpringCmmnEngineConfiguration\"/>\n// after\n<bean id=\"cmmnEngineConfiguration\" class=\"org.flowable.cmmn.spring.SpringCmmnEngineConfiguration\"/>\n<bean id=\"cmmnEngine\" factory-bean=\"cmmnEngineConfiguration\" factory-method=\"buildCmmnEngine\"/>","handlingStrategy":"try-catch","validationCode":"// load the context and check beans first\nGenericXmlApplicationContext ctx = new GenericXmlApplicationContext(new UrlResource(resource));\nboolean hasEngine = !ctx.getBeansOfType(CmmnEngine.class).isEmpty();\nctx.close();","typeGuard":null,"tryCatchPattern":"try { return SpringCmmnConfigurationHelper.buildCmmnEngine(url); } catch (FlowableException e) { if (e.getMessage().contains(\"defined in the application context\")) { log.error(\"Spring XML {} lacks a CmmnEngine bean\", url); } throw e; }","preventionTips":["Always declare a bean of type CmmnEngine in the Spring XML used for bootstrapping","Verify the resource URL points at the intended context file","Check Spring context startup logs for earlier bean-definition failures"],"tags":["spring","configuration","engine-bootstrap"],"backgroundTag":"missing-required-config","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"}