{"record":{"id":"5b19505345d50f5c","repo":"flowable/flowable-engine","slug":"no-org-flowable-idm-engine-idmengine-defined-in-th","errorCode":null,"errorMessage":"no org.flowable.idm.engine.IdmEngine defined in the application context ${resource}","messagePattern":"no org\\.flowable\\.idm\\.engine\\.IdmEngine defined in the application context (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-spring/src/main/java/org/flowable/idm/spring/SpringIdmConfigurationHelper.java","lineNumber":40,"sourceCode":"import org.slf4j.LoggerFactory;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.support.GenericXmlApplicationContext;\nimport org.springframework.core.io.UrlResource;\n\n/**\n * @author Tom Baeyens\n */\npublic class SpringIdmConfigurationHelper {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(SpringIdmConfigurationHelper.class);\n\n    public static IdmEngine buildIdmEngine(URL resource) {\n        LOGGER.debug(\"==== BUILDING SPRING APPLICATION CONTEXT AND IDM ENGINE =========================================\");\n\n        ApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource));\n        Map<String, IdmEngine> beansOfType = applicationContext.getBeansOfType(IdmEngine.class);\n        if ((beansOfType == null) || beansOfType.isEmpty()) {\n            throw new FlowableException(\"no \" + IdmEngine.class.getName() + \" defined in the application context \" + resource);\n        }\n\n        IdmEngine idmEngine = beansOfType.values().iterator().next();\n\n        LOGGER.debug(\"==== SPRING IDM ENGINE CREATED ==================================================================\");\n        return idmEngine;\n    }\n\n}\n","sourceCodeStart":22,"sourceCodeEnd":50,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-spring/src/main/java/org/flowable/idm/spring/SpringIdmConfigurationHelper.java#L22-L50","documentation":"FlowableException thrown by SpringIdmConfigurationHelper.buildIdmEngine when the Spring XML application context loaded from the given URL defines no bean of type org.flowable.idm.engine.IdmEngine. The helper requires the context to actually instantiate an IdmEngine bean, which it then returns.","triggerScenarios":"buildIdmEngine(url) called with an XML context that lacks an <bean class=\"...IdmEngine\"/> (or flowable idm engine definition), or the bean is of a different engine type (e.g. only a ProcessEngine bean).","commonSituations":"Reusing a process-engine spring XML for the idm engine bootstrap; forgetting the idmEngine bean after refactoring context files; bean defined but lazily not matching the IdmEngine type; wrong resource URL loading an unrelated XML.","solutions":["Add an IdmEngine bean to the Spring XML context, e.g. a bean created via SpringIdmEngineConfiguration / IdmEngineFactoryBean","Verify the URL/resource points at the intended application context file","Check the bean's class actually implements org.flowable.idm.engine.IdmEngine (not just IdmEngineConfiguration)","If no XML context is needed, build the engine programmatically with new StandaloneIdmEngineConfiguration().buildEngine() instead"],"exampleFix":"// before (context.xml has no IdmEngine bean)\nIdmEngine e = SpringIdmConfigurationHelper.buildIdmEngine(url);\n// after: add to context.xml\n<bean id=\"idmEngine\" class=\"org.flowable.idm.engine.impl.IdmEngineFactoryBean\">\n  <property name=\"idmEngineConfiguration\" ref=\"idmEngineConfiguration\"/>\n</bean>","handlingStrategy":"validation","validationCode":"// verify the XML context defines an IdmEngine before bootstrapping\nApplicationContext ctx = new GenericXmlApplicationContext(new UrlResource(resource));\nif (ctx.getBeansOfType(IdmEngine.class).isEmpty()) {\n  throw new IllegalStateException(resource + \" does not declare an IdmEngine bean\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a dedicated idm spring XML containing the IdmEngine bean definition","Point buildIdmEngine at the correct resource URL","Prefer programmatic StandaloneIdmEngineConfiguration when no Spring context is required"],"tags":["spring","configuration","missing-bean","xml-context","flowable"],"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"}