{"record":{"id":"cb3e36c2eb83f090","repo":"flowable/flowable-engine","slug":"no-org-flowable-dmn-engine-dmnengine-defined-in-th","errorCode":null,"errorMessage":"no org.flowable.dmn.engine.DmnEngine defined in the application context <resource>","messagePattern":"no org\\.flowable\\.dmn\\.engine\\.DmnEngine defined in the application context <resource>","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/SpringDmnConfigurationHelper.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 Tom Baeyens\n */\npublic class SpringDmnConfigurationHelper {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(SpringDmnConfigurationHelper.class);\n\n    public static DmnEngine buildDmnEngine(URL resource) {\n        LOGGER.debug(\"==== BUILDING SPRING APPLICATION CONTEXT AND DMN ENGINE =========================================\");\n\n        try (GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource))) {\n            Map<String, DmnEngine> beansOfType = applicationContext.getBeansOfType(DmnEngine.class);\n            if ((beansOfType == null) || beansOfType.isEmpty()) {\n                throw new FlowableException(\"no \" + DmnEngine.class.getName() + \" defined in the application context \" + resource);\n            }\n\n            DmnEngine dmnEngine = beansOfType.values().iterator().next();\n\n            LOGGER.debug(\"==== SPRING DMN ENGINE CREATED ==================================================================\");\n            return dmnEngine;\n        }\n    }\n\n}\n","sourceCodeStart":21,"sourceCodeEnd":50,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/SpringDmnConfigurationHelper.java#L21-L50","documentation":"SpringDmnConfigurationHelper.buildDmnEngine(URL) boots a GenericXmlApplicationContext from the given XML resource and looks up beans of type DmnEngine. If the Spring context contains no DmnEngine bean, it throws FlowableException stating no org.flowable.dmn.engine.DmnEngine is defined in that application context.","triggerScenarios":"Calling buildDmnEngine with a Spring XML resource that defines no bean of type DmnEngine (e.g. only other beans, wrong namespace, or a bean of a different engine type).","commonSituations":"Passing a generic Spring XML config (applicationContext.xml with no engine bean), pointing at a BPMN engine context instead of a DMN one, bean defined with a class that fails to instantiate or isn't a DmnEngine, or a typo in the bean class name in XML.","solutions":["Add a DmnEngine bean to the XML, e.g. <bean id=\"dmnEngine\" class=\"org.flowable.dmn.spring.DmnEngineFactoryBean\"><property name=\"dmnEngineConfiguration\" ref=\"dmnEngineConfig\"/></bean> with a matching SpringDmnEngineConfiguration bean.","Verify the URL points at the intended DMN Spring context file and the file loaded without errors (check context startup logs).","Confirm the bean's class actually implements org.flowable.dmn.engine.DmnEngine.","Alternatively construct the engine programmatically from a SpringDmnEngineConfiguration instead of via XML helper."],"exampleFix":"// before (dmn-spring.xml has only a datasource bean, no engine bean)\nDmnEngine engine = SpringDmnConfigurationHelper.buildDmnEngine(url);\n// after (dmn-spring.xml adds)\n// <bean id=\"dmnEngineConfig\" class=\"org.flowable.dmn.spring.SpringDmnEngineConfiguration\">...</bean>\n// <bean id=\"dmnEngine\" class=\"org.flowable.dmn.spring.DmnEngineFactoryBean\" p:dmnEngineConfiguration-ref=\"dmnEngineConfig\"/>\nDmnEngine engine = SpringDmnConfigurationHelper.buildDmnEngine(url);","handlingStrategy":"validation","validationCode":"GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(new UrlResource(resource));\nif (ctx.getBeansOfType(DmnEngine.class).isEmpty()) throw new IllegalStateException(resource + ' defines no DmnEngine bean');","typeGuard":null,"tryCatchPattern":"try { return SpringDmnConfigurationHelper.buildDmnEngine(resource); }\ncatch (FlowableException e) { throw new IllegalStateException('Spring XML must define a DmnEngine bean: ' + resource, e); }","preventionTips":["Keep a dedicated DMN Spring context defining a DmnEngineFactoryBean bean","Check context startup logs for bean definition errors","Verify the bean class implements org.flowable.dmn.engine.DmnEngine","Prefer programmatic SpringDmnEngineConfiguration over XML helpers"],"tags":["spring","configuration","dmn","bean-definition"],"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-14T11:17:12.474Z"}