{"record":{"id":"3ff78672ca67406d","repo":"flowable/flowable-engine","slug":"couldn-t-initialize-dmn-engine-from-spring-configu","errorCode":null,"errorMessage":"couldn't initialize dmn engine from spring configuration resource \" + resource + \": \" + e.getMessage()","messagePattern":"couldn't initialize dmn engine from spring configuration resource \" \\+ resource \\+ \": \" \\+ e\\.getMessage\\(\\)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngines.java","lineNumber":108,"sourceCode":"            setInitialized(true);\n        } else {\n            LOGGER.info(\"DMN engines already initialized\");\n        }\n    }\n\n    protected static void initDmnEngineFromSpringResource(URL resource) {\n        try {\n            Class<?> springConfigurationHelperClass = ReflectUtil.loadClass(\"org.flowable.dmn.spring.SpringDmnConfigurationHelper\");\n            Method method = springConfigurationHelperClass.getDeclaredMethod(\"buildDmnEngine\", new Class<?>[] { URL.class });\n            DmnEngine dmnEngine = (DmnEngine) method.invoke(null, new Object[] { resource });\n\n            String dmnEngineName = dmnEngine.getName();\n            EngineInfo dmnEngineInfo = new EngineInfo(dmnEngineName, resource.toString(), null);\n            dmnEngineInfosByName.put(dmnEngineName, dmnEngineInfo);\n            dmnEngineInfosByResourceUrl.put(resource.toString(), dmnEngineInfo);\n\n        } catch (Exception e) {\n            throw new FlowableException(\"couldn't initialize dmn engine from spring configuration resource \" + resource + \": \" + e.getMessage(), e);\n        }\n    }\n\n    /**\n     * Registers the given dmn engine. No {@link EngineInfo} will be available for this dmn engine. An engine that is registered will be closed when the {@link DmnEngines#destroy()} is called.\n     */\n    public static void registerDmnEngine(DmnEngine dmnEngine) {\n        dmnEngines.put(dmnEngine.getName(), dmnEngine);\n    }\n\n    /**\n     * Unregisters the given dmn engine.\n     */\n    public static void unregister(DmnEngine dmnEngine) {\n        dmnEngines.remove(dmnEngine.getName());\n    }\n\n    private static EngineInfo initDmnEngineFromResource(URL resourceUrl) {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngines.java#L90-L126","documentation":"When a flowable-dmn-context.xml Spring resource is found, DmnEngines.initDmnEngineFromSpringResource builds the engine from that Spring configuration. Any exception during that process is wrapped in this FlowableException including the resource name and e.getMessage(), so the DMN engine could not be initialized from Spring config.","triggerScenarios":"DmnEngines.init() encountering a flowable-dmn-context.xml whose Spring bean definitions fail to load or produce a DMN engine (bad bean class, XML parse error, missing beans, bean init exception).","commonSituations":"Hand-edited Spring context XML referencing classes not on the classpath, invalid XML syntax, version mismatch between the context file's bean classes and the DMN engine API, missing Spring dependencies.","solutions":["Read the wrapped cause 'e' for the real Spring failure (XML parse, ClassNotFound, bean init).","Validate the flowable-dmn-context.xml is well-formed and its beans reference existing classes/properties.","Ensure Spring (spring-context/beans) and flowable-dmn-engine jars are on the classpath.","Check bean property values against the DMN engine version's API (rename outdated setters)."],"exampleFix":"// before (context XML)\n<bean id=\"dmnEngineConfiguration\" class=\"org.flowable.dmn.engine.OldCfg\"/>\n// after\n<bean id=\"dmnEngineConfiguration\" class=\"org.flowable.dmn.engine.DmnEngineConfiguration\"/>\n<bean id=\"dmnEngine\" factory-bean=\"dmnEngineConfiguration\" factory-method=\"buildDmnEngine\"/>","handlingStrategy":"try-catch","validationCode":"// Validate the Spring resource parses and beans resolve before init\nnew ClassPathXmlApplicationContext(\"flowable-dmn-context.xml\").close(); // throws early on bad config","typeGuard":null,"tryCatchPattern":"try { DmnEngine engine = DmnEngines.getDmnEngine(); } catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"couldn't initialize dmn engine from spring configuration resource\")) { log.error(\"Spring config failure: {}\", e.getCause(), e); }\n    throw e;\n}","preventionTips":["Keep flowable-dmn-context.xml in version control and schema-validated","Reference only classes present in the DMN engine version in use","Test Spring context loading in unit tests","Always inspect the wrapped cause 'e' for the real error"],"tags":["dmn","spring","engine-bootstrap","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"}