Activiti/Activiti · critical · ActivitiException

Activiti database problem

Error message

Activiti database problem: ${errorMessage}

What it means

As the final part of dbSchemaCheckVersion, Activiti verifies that required table groups (engine, history, identity) are present. If any are missing it throws ActivitiException listing the missing components, meaning the database is incompletely initialized.

Solutions

  1. Set databaseSchemaUpdate=true so missing tables are created automatically
  2. Run the schema creation scripts manually (activiti.<db>.create.*.sql)
  3. Point the engine at the correct, fully initialized database

Example fix

// before
<property name="databaseSchemaUpdate" value="false"/>
// after
<property name="databaseSchemaUpdate" value="true"/>
Defensive patterns

Strategy: validation

Validate before calling

boolean hasEngine = dbSqlSession.isEngineTablePresent();
boolean hasHistory = dbSqlSession.isHistoryTablePresent();
boolean hasIdentity = dbSqlSession.isIdentityTablePresent();
if (!hasEngine || !hasHistory || !hasIdentity) cfg.setDatabaseSchemaUpdate("true");

Try / catch

try {
    processEngine = cfg.buildProcessEngine();
} catch (ActivitiException e) {
    if (e.getMessage().contains("Activiti database problem")) recreateMissingTables();
    throw e;
}

Prevention

When it happens

Trigger: Engine startup (schema check) against a database where ACT_* tables are partially present — e.g. engine tables exist but history or identity tables were dropped or never created.

Common situations: Partial manual schema creation; someone dropped tables; restoring a partial DB backup; pointing the engine at a database initialized for another product.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09). Data as JSON: /api/errors/654e4bc07a001177. Report an issue: GitHub.

Appendix: source

Thrown at activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSession.java:894

    // ////////////////////////////////////////////////////////

    public void dbSchemaCheckVersion() {
        try {
            String dbVersion = getDbVersion();
            if (!ProcessEngine.VERSION.equals(dbVersion)) {
                throw new ActivitiWrongDbException(ProcessEngine.VERSION, dbVersion);
            }

            String errorMessage = null;
            if (!isEngineTablePresent()) {
                errorMessage = addMissingComponent(errorMessage, "engine");
            }
            if (dbSqlSessionFactory.isDbHistoryUsed() && !isHistoryTablePresent()) {
                errorMessage = addMissingComponent(errorMessage, "history");
            }

            if (errorMessage != null) {
                throw new ActivitiException("Activiti database problem: " + errorMessage);
            }
        } catch (Exception e) {
            if (isMissingTablesException(e)) {
                throw new ActivitiException(
                    "no activiti tables in db. set <property name=\"databaseSchemaUpdate\" to value=\"true\" or value=\"create-drop\" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation",
                    e
                );
            } else {
                if (e instanceof RuntimeException) {
                    throw (RuntimeException) e;
                } else {
                    throw new ActivitiException("couldn't get db schema version", e);
                }
            }
        }

        log.debug("activiti db schema check successful");
    }

View on GitHub (pinned to 56435b1a97)