{"record":{"id":"7c9ec1b9af5c8da0","repo":"flowable/flowable-engine","slug":"no-org-flowable-engine-processengine-defined-in-th","errorCode":null,"errorMessage":"no org.flowable.engine.ProcessEngine defined in the application context ","messagePattern":"no org\\.flowable\\.engine\\.ProcessEngine defined in the application context ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-spring/src/main/java/org/flowable/spring/SpringConfigurationHelper.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 SpringConfigurationHelper {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(SpringConfigurationHelper.class);\n\n    public static ProcessEngine buildProcessEngine(URL resource) {\n        LOGGER.debug(\"==== BUILDING SPRING APPLICATION CONTEXT AND PROCESS ENGINE =========================================\");\n\n        try (GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource))) {\n            Map<String, ProcessEngine> beansOfType = applicationContext.getBeansOfType(ProcessEngine.class);\n            if ((beansOfType == null) || beansOfType.isEmpty()) {\n                throw new FlowableException(\"no \" + ProcessEngine.class.getName() + \" defined in the application context \" + resource);\n            }\n\n            ProcessEngine processEngine = beansOfType.values().iterator().next();\n\n            LOGGER.debug(\"==== SPRING PROCESS ENGINE CREATED ==================================================================\");\n            return processEngine;\n        }\n    }\n\n}\n","sourceCodeStart":21,"sourceCodeEnd":50,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-spring/src/main/java/org/flowable/spring/SpringConfigurationHelper.java#L21-L50","documentation":"SpringConfigurationHelper.buildProcessEngine loads a Spring XML application context from the given URL and searches it for a bean of type org.flowable.engine.ProcessEngine. If the context contains no such bean (or the lookup returns null/empty), it throws this FlowableException. It means the Spring configuration file provided to the helper does not actually define a Flowable process engine.","triggerScenarios":"Calling SpringConfigurationHelper.buildProcessEngine(url) with an XML resource that has no <bean> of type ProcessEngine / SpringProcessEngineConfiguration, or where the engine bean is defined in a different (imported, not imported) context.","commonSituations":"Pointing the helper at the wrong XML file or one missing the flowable engine configuration; engine bean defined in a parent context not loaded by this URL; classpath resource resolution loading an empty/stale file; migration where the bean id/type was renamed.","solutions":["Add a SpringProcessEngineConfiguration bean (which exposes a ProcessEngine) to the XML context passed to buildProcessEngine.","Check the URL/resource path — verify it resolves to the intended XML file (log/print resource and inspect it).","If the engine bean lives in another context file, merge or import it into the context being loaded.","If you do not need Spring wiring, use ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration() instead of the Spring helper."],"exampleFix":"// before: XML with no engine bean\n<beans>...</beans>\n\n// after: define the engine bean in the context passed to buildProcessEngine\n<bean id=\"processEngineConfiguration\" class=\"org.flowable.spring.SpringProcessEngineConfiguration\">\n    <property name=\"dataSource\" ref=\"dataSource\"/>\n    <property name=\"transactionManager\" ref=\"transactionManager\"/>\n    <property name=\"databaseSchemaUpdate\" value=\"true\"/>\n</bean>\n<bean id=\"processEngine\" class=\"org.flowable.spring.ProcessEngineFactoryBean\">\n    <property name=\"processEngineConfiguration\" ref=\"processEngineConfiguration\"/>\n</bean>","handlingStrategy":"validation","validationCode":"GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(new UrlResource(resource));\nboolean ok = !ctx.getBeansOfType(ProcessEngine.class).isEmpty();\nif (!ok) throw new IllegalStateException(\"XML context \" + resource + \" defines no ProcessEngine bean\");","typeGuard":null,"tryCatchPattern":"try {\n    ProcessEngine engine = SpringConfigurationHelper.buildProcessEngine(url);\n} catch (FlowableException e) {\n    // log the resource URL and fail startup with a clear config message\n}","preventionTips":["Keep the ProcessEngine bean (ProcessEngineFactoryBean) in the exact XML file you pass to buildProcessEngine","Verify resource URL resolution logs the intended file","Prefer Spring Boot auto-configuration or standalone configuration over manual XML wiring when possible"],"tags":["spring","configuration","process-engine","missing-bean"],"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"}