flowable/flowable-engine · error · IllegalStateException

Idm engine has not been initialized

Error message

Idm engine has not been initialized

What it means

IdmEngineServicesAutoConfiguration exposes the already-initialized IDM (identity) engine from the static IdmEngines registry as a bean. If the registry is not initialized when the bean method runs, it throws this IllegalStateException. The injected ProcessEngine normally bootstraps the IDM engine.

Solutions

  1. Ensure a ProcessEngine is auto-configured (it initializes the IDM engine by default)
  2. Add the IDM engine configurator explicitly if building engines manually
  3. Let auto-configuration create a standalone IdmEngineConfiguration bean rather than the already-initialized bean
  4. Check startup logs for prior engine initialization failures

Example fix

// before: manual process engine without IDM
new ProcessEngineConfiguration();
// after
config.addConfigurator(new IdmEngineConfigurator());
Defensive patterns

Strategy: validation

Validate before calling

if (!IdmEngines.isInitialized()) { throw new IllegalStateException("Initialize the IDM engine (via ProcessEngine) first"); }

Type guard

boolean idmAvailable = IdmEngines.isInitialized();

Try / catch

try { return IdmEngines.getDefaultIdmEngine(); } catch (IllegalStateException e) { /* fallback: build IdmEngineConfiguration */ }

Prevention

When it happens

Trigger: Auto-configuration selects AlreadyInitializedEngineConfiguration and idmEngine(ProcessEngine) runs while IdmEngines.isInitialized() is false — no process/IDM engine bootstrap ran beforehand.

Common situations: Process engine auto-configuration disabled or failing while IDM beans are still requested; custom engine setup that skips the IDM configurator; dependency conflicts removing flowable-idm-engine.

Related errors


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

Appendix: source

Thrown at modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/idm/IdmEngineServicesAutoConfiguration.java:70

    /**
     * If a process engine is present that means that the IdmEngine was created as part of it.
     * Therefore extract it from the IdmEngines.
     */
    @Configuration(proxyBeanMethods = false)
    @ConditionalOnMissingBean(type = {
        "org.flowable.idm.engine.IdmEngine",
        "org.flowable.app.engine.AppEngine"
    })
    @ConditionalOnBean(type = {
        "org.flowable.engine.ProcessEngine"
    })
    static class AlreadyInitializedEngineConfiguration {

        @Bean
        public IdmEngine idmEngine(@SuppressWarnings("unused") ProcessEngine processEngine) {
            // The process engine needs to be injected, as otherwise it won't be initialized, which means that the IdmEngine is not initialized yet
            if (!IdmEngines.isInitialized()) {
                throw new IllegalStateException("Idm engine has not been initialized");
            }
            return IdmEngines.getDefaultIdmEngine();
        }
    }
    
    /**
     * If an app engine is present that means that the IdmEngine was created as part of it.
     * Therefore extract it from the IdmEngines.
     */
    @Configuration(proxyBeanMethods = false)
    @ConditionalOnMissingBean(type = {
        "org.flowable.idm.engine.IdmEngine",
    })
    @ConditionalOnBean(type = {
        "org.flowable.app.engine.AppEngine"
    })
    static class AlreadyInitializedAppEngineConfiguration {

View on GitHub (pinned to d6d39ce1c6)