flowable/flowable-engine · critical · ActivitiException

couldn't deduct database type from database product name

Error message

couldn't deduct database type from database product name '${databaseProductName}'

What it means

During database initialization the engine connects to the datasource, reads DatabaseMetaData.getDatabaseProductName(), and maps it via databaseTypeMappings to an internal databaseType (h2, mysql, postgres, oracle, etc.). If the product name has no mapping, initDatabaseType throws this ActivitiException because the engine cannot select database-specific SQL.

Solutions

  1. Upgrade to an Activiti/Flowable version that supports your database
  2. Explicitly set databaseType on the configuration (e.g. cfg.setDatabaseType("postgres")) to skip auto-detection
  3. If using a proxy/brand, check the reported product name via JDBC metadata and set databaseType to the underlying DB type
  4. Extend databaseTypeMappings programmatically (DatabaseTypeMappings property) before engine init if you must support a custom DB

Example fix

// before
JtaProcessEngineConfiguration cfg = ...; // auto-detect fails for new DB
// after
cfg.setDatabaseType("mysql"); // skip product-name detection
cfg.buildProcessEngine();
Defensive patterns

Strategy: validation

Validate before calling

try (Connection c = cfg.getDataSource().getConnection()) {
  String product = c.getMetaData().getDatabaseProductName();
  Set<String> supported = Set.of("H2", "MySQL", "PostgreSQL", "Oracle", "Microsoft SQL Server", "DB2");
  if (supported.stream().noneMatch(product::contains) && cfg.getDatabaseType() == null) {
    throw new IllegalStateException("Unsupported DB product '" + product + "': set databaseType explicitly");
  }
}

Try / catch

try {
  processEngine = cfg.buildProcessEngine();
} catch (ActivitiException e) {
  if (e.getMessage().startsWith("couldn't deduct database type")) {
    cfg.setDatabaseType("postgres"); // or appropriate type
    processEngine = cfg.buildProcessEngine();
  } else throw e;
}

Prevention

When it happens

Trigger: Connecting to a database whose product name string is not in the mapping table — uncommon databases, forks/embedded engines with custom product names, or new major DB versions with renamed product strings in older Activiti versions.

Common situations: Using an unsupported/rare DB (e.g. some cloud or sharded proxies that alter the product name); newer database versions whose product name changed vs. the engine version; proxies like PgBouncer variants reporting unusual metadata.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java:825

        databaseTypeMappings.setProperty("DB2/HP64", DATABASE_TYPE_DB2);
        databaseTypeMappings.setProperty("DB2/SUN", DATABASE_TYPE_DB2);
        databaseTypeMappings.setProperty("DB2/SUN64", DATABASE_TYPE_DB2);
        databaseTypeMappings.setProperty("DB2/PTX", DATABASE_TYPE_DB2);
        databaseTypeMappings.setProperty("DB2/2", DATABASE_TYPE_DB2);
        databaseTypeMappings.setProperty("DB2 UDB AS400", DATABASE_TYPE_DB2);
        return databaseTypeMappings;
    }

    public void initDatabaseType() {
        Connection connection = null;
        try {
            connection = dataSource.getConnection();
            DatabaseMetaData databaseMetaData = connection.getMetaData();
            String databaseProductName = databaseMetaData.getDatabaseProductName();
            LOGGER.debug("database product name: '{}'", databaseProductName);
            databaseType = databaseTypeMappings.getProperty(databaseProductName);
            if (databaseType == null) {
                throw new ActivitiException("couldn't deduct database type from database product name '" + databaseProductName + "'");
            }
            LOGGER.debug("using database type: {}", databaseType);

        } catch (SQLException e) {
            LOGGER.error("Exception while initializing Database connection", e);
        } finally {
            try {
                if (connection != null) {
                    connection.close();
                }
            } catch (SQLException e) {
                LOGGER.error("Exception while closing the Database connection", e);
            }
        }
    }

    // myBatis SqlSessionFactory ////////////////////////////////////////////////

View on GitHub (pinned to d6d39ce1c6)