flowable/flowable-engine · error · FlowableException

no " + CmmnEngine.class.getName() + " defined in the applica

Error message

no " + CmmnEngine.class.getName() + " defined in the application context " + resource

What it means

FlowableException thrown by SpringCmmnConfigurationHelper.buildCmmnEngine(URL) after loading a Spring XML application context from the given resource URL when no bean of type CmmnEngine exists in it. The helper expects the Spring config to define the engine as a bean so it can return it.

Source

Thrown at modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnConfigurationHelper.java:39

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.core.io.UrlResource;

/**
 * @author Tijs Rademakers
 */
public class SpringCmmnConfigurationHelper {

    private static final Logger LOGGER = LoggerFactory.getLogger(SpringCmmnConfigurationHelper.class);

    public static CmmnEngine buildCmmnEngine(URL resource) {
        LOGGER.debug("==== BUILDING SPRING APPLICATION CONTEXT AND CMMN ENGINE =========================================");

        try (GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource))) {
            Map<String, CmmnEngine> beansOfType = applicationContext.getBeansOfType(CmmnEngine.class);
            if ((beansOfType == null) || beansOfType.isEmpty()) {
                throw new FlowableException("no " + CmmnEngine.class.getName() + " defined in the application context " + resource);
            }

            CmmnEngine cmmnEngine = beansOfType.values().iterator().next();

            LOGGER.debug("==== SPRING CMMN ENGINE CREATED ==================================================================");
            return cmmnEngine;
        }
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Define a bean of type CmmnEngine in the Spring XML (e.g. <bean id="cmmnEngine" class="org.flowable.cmmn.engine.CmmnEngine" factory-bean=... factory-method="buildCmmnEngine"/>)
  2. Point the URL at the correct application-context resource that actually contains the engine bean
  3. Verify the bean's class/factory produces CmmnEngine (not just CmmnEngineConfiguration)
  4. Check application logs for Spring context load errors preceding this exception

Example fix

// before (no engine bean in XML)
<bean id="cmmnEngineConfiguration" class="org.flowable.cmmn.spring.SpringCmmnEngineConfiguration"/>
// after
<bean id="cmmnEngineConfiguration" class="org.flowable.cmmn.spring.SpringCmmnEngineConfiguration"/>
<bean id="cmmnEngine" factory-bean="cmmnEngineConfiguration" factory-method="buildCmmnEngine"/>
Defensive patterns

Strategy: try-catch

Validate before calling

// load the context and check beans first
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(new UrlResource(resource));
boolean hasEngine = !ctx.getBeansOfType(CmmnEngine.class).isEmpty();
ctx.close();

Try / catch

try { return SpringCmmnConfigurationHelper.buildCmmnEngine(url); } catch (FlowableException e) { if (e.getMessage().contains("defined in the application context")) { log.error("Spring XML {} lacks a CmmnEngine bean", url); } throw e; }

Prevention

When it happens

Trigger: Calling CmmnEngineConfiguration via a spring-config resource URL (e.g. flowable.cmmn.cfg.xml style Spring context) where the XML defines no <bean> implementing CmmnEngine, or defines it under the wrong type/interface.

Common situations: Spring XML missing the cmmnEngine bean; bean defined as the configuration class instead of the engine; bean factory returning null/empty map; wrong resource URL pointing to an unrelated context file.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


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