{"record":{"id":"a016c943d848a795","repo":"flowable/flowable-engine","slug":"couldn-t-initialize-app-engine-from-spring-configu","errorCode":null,"errorMessage":"couldn't initialize app engine from spring configuration resource <resource>: <e.getMessage()>","messagePattern":"couldn't initialize app engine from spring configuration resource <resource>: <e\\.getMessage\\(\\)>","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngines.java","lineNumber":106,"sourceCode":"            setInitialized(true);\n        } else {\n            LOGGER.info(\"App engines already initialized\");\n        }\n    }\n\n    protected static void initAppEngineFromSpringResource(URL resource) {\n        try {\n            Class<?> springConfigurationHelperClass = ReflectUtil.loadClass(\"org.flowable.app.spring.SpringAppConfigurationHelper\");\n            Method method = springConfigurationHelperClass.getDeclaredMethod(\"buildAppEngine\", new Class<?>[] { URL.class });\n            AppEngine appEngine = (AppEngine) method.invoke(null, new Object[] { resource });\n\n            String appEngineName = appEngine.getName();\n            EngineInfo appEngineInfo = new EngineInfo(appEngineName, resource.toString(), null);\n            appEngineInfosByName.put(appEngineName, appEngineInfo);\n            appEngineInfosByResourceUrl.put(resource.toString(), appEngineInfo);\n\n        } catch (Exception e) {\n            throw new FlowableException(\"couldn't initialize app engine from spring configuration resource \" + resource + \": \" + e.getMessage(), e);\n        }\n    }\n\n    /**\n     * Registers the given app engine. No {@link EngineInfo} will be available for this app engine. An engine that is registered will be closed when the {@link AppEngines#destroy()} is called.\n     */\n    public static void registerAppEngine(AppEngine appEngine) {\n        appEngines.put(appEngine.getName(), appEngine);\n    }\n\n    /**\n     * Unregisters the given app engine.\n     */\n    public static void unregister(AppEngine appEngine) {\n        appEngines.remove(appEngine.getName());\n    }\n\n    private static EngineInfo initAppEngineFromResource(URL resourceUrl) {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngines.java#L88-L124","documentation":"When AppEngines.init() builds an app engine from a discovered flowable-app-context.xml Spring resource, any exception during engine construction is wrapped in this FlowableException naming the resource and the original message. It means the Spring configuration was found but the engine could not be created from it.","triggerScenarios":"initAppEngineFromSpringResource encountering any Exception (bean wiring failures, missing beans, DB errors during engine build) while processing a discovered spring resource.","commonSituations":"flowable-app-context.xml referencing missing beans/properties, datasource misconfiguration in the Spring XML, duplicate engine names, or database connectivity failures during first engine build.","solutions":["Read the cause chain — the wrapped exception pinpoints the actual construction failure.","Validate the Spring XML resource: bean ids, property values, datasource settings.","Check database connectivity and schema for the configured datasource.","Ensure engine names are unique across all discovered flowable-app-context.xml resources."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate spring config resources exist and are parseable\nnew ClassPathXmlApplicationContext(\"flowable-app-context.xml\").close();","typeGuard":null,"tryCatchPattern":"try { AppEngines.initAppEngineFromSpringResource(url); } catch (FlowableException e) {\n    log.error(\"Engine build failed for \" + url + \": \" + e.getCause(), e);\n}","preventionTips":["Always inspect the cause chain, the message names only the resource","Validate datasource and bean definitions in the XML","Ensure unique engine names across resources","Test engine startup in CI with the same config"],"tags":["spring","engine-init","configuration"],"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"}