flowable/flowable-engine · error · FlowableException

couldn't initialize dmn engine from spring configuration res

Error message

couldn't initialize dmn engine from spring configuration resource " + resource + ": " + e.getMessage()

What it means

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.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngines.java:108

            setInitialized(true);
        } else {
            LOGGER.info("DMN engines already initialized");
        }
    }

    protected static void initDmnEngineFromSpringResource(URL resource) {
        try {
            Class<?> springConfigurationHelperClass = ReflectUtil.loadClass("org.flowable.dmn.spring.SpringDmnConfigurationHelper");
            Method method = springConfigurationHelperClass.getDeclaredMethod("buildDmnEngine", new Class<?>[] { URL.class });
            DmnEngine dmnEngine = (DmnEngine) method.invoke(null, new Object[] { resource });

            String dmnEngineName = dmnEngine.getName();
            EngineInfo dmnEngineInfo = new EngineInfo(dmnEngineName, resource.toString(), null);
            dmnEngineInfosByName.put(dmnEngineName, dmnEngineInfo);
            dmnEngineInfosByResourceUrl.put(resource.toString(), dmnEngineInfo);

        } catch (Exception e) {
            throw new FlowableException("couldn't initialize dmn engine from spring configuration resource " + resource + ": " + e.getMessage(), e);
        }
    }

    /**
     * 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.
     */
    public static void registerDmnEngine(DmnEngine dmnEngine) {
        dmnEngines.put(dmnEngine.getName(), dmnEngine);
    }

    /**
     * Unregisters the given dmn engine.
     */
    public static void unregister(DmnEngine dmnEngine) {
        dmnEngines.remove(dmnEngine.getName());
    }

    private static EngineInfo initDmnEngineFromResource(URL resourceUrl) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Read the wrapped cause 'e' for the real Spring failure (XML parse, ClassNotFound, bean init).
  2. Validate the flowable-dmn-context.xml is well-formed and its beans reference existing classes/properties.
  3. Ensure Spring (spring-context/beans) and flowable-dmn-engine jars are on the classpath.
  4. Check bean property values against the DMN engine version's API (rename outdated setters).

Example fix

// before (context XML)
<bean id="dmnEngineConfiguration" class="org.flowable.dmn.engine.OldCfg"/>
// after
<bean id="dmnEngineConfiguration" class="org.flowable.dmn.engine.DmnEngineConfiguration"/>
<bean id="dmnEngine" factory-bean="dmnEngineConfiguration" factory-method="buildDmnEngine"/>
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate the Spring resource parses and beans resolve before init
new ClassPathXmlApplicationContext("flowable-dmn-context.xml").close(); // throws early on bad config

Try / catch

try { DmnEngine engine = DmnEngines.getDmnEngine(); } catch (FlowableException e) {
    if (e.getMessage().startsWith("couldn't initialize dmn engine from spring configuration resource")) { log.error("Spring config failure: {}", e.getCause(), e); }
    throw e;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/3ff78672ca67406d. Report an issue: GitHub.