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
- Upgrade to an Activiti/Flowable version that supports your database
- Explicitly set databaseType on the configuration (e.g. cfg.setDatabaseType("postgres")) to skip auto-detection
- If using a proxy/brand, check the reported product name via JDBC metadata and set databaseType to the underlying DB type
- 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
- Set databaseType explicitly when using proxies or uncommon databases
- Keep engine version compatible with your DB version
- Print getDatabaseProductName() during environment validation
- Upgrade Flowable/Activiti when adopting a new database release
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
- Cannot set JPA variable: " + EntityManagerSession.class + "…
- Could not set database catalog on connection
- Could not set database schema on connection
- couldn't lookup datasource from
- DataSource or JDBC properties have to be specified in a…
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)