YunaiV/ruoyi-vue-pro · critical · FlowableException
DataSource or JDBC properties have to be specified in a proc
Error message
DataSource or JDBC properties have to be specified in a process engine configuration
What it means
When dataSource and dataSourceJndiName are null but jdbcUrl is provided, Flowable requires jdbcDriver and jdbcUsername as well. If either is null the engine cannot build a PooledDataSource and throws FlowableException at startup. This is a configuration-completeness guard.
Source
Thrown at sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java:451
protected void initEngineConfigurations() {
addEngineConfiguration(getEngineCfgKey(), getEngineScopeType(), this);
}
// DataSource
// ///////////////////////////////////////////////////////////////
protected void initDataSource() {
if (dataSource == null) {
if (dataSourceJndiName != null) {
try {
dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName);
} catch (Exception e) {
throw new FlowableException("couldn't lookup datasource from " + dataSourceJndiName + ": " + e.getMessage(), e);
}
} else if (jdbcUrl != null) {
if ((jdbcDriver == null) || (jdbcUsername == null)) {
throw new FlowableException("DataSource or JDBC properties have to be specified in a process engine configuration");
}
logger.debug("initializing datasource to db: {}", jdbcUrl);
if (logger.isInfoEnabled()) {
logger.info("Configuring Datasource with following properties (omitted password for security)");
logger.info("datasource driver : {}", jdbcDriver);
logger.info("datasource url : {}", jdbcUrl);
logger.info("datasource user name : {}", jdbcUsername);
}
PooledDataSource pooledDataSource = new PooledDataSource(this.getClass().getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword);
if (jdbcMaxActiveConnections > 0) {
pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections);
}
if (jdbcMaxIdleConnections > 0) {
pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections);View on GitHub (pinned to 0418084e22)
Solutions
- Set all three: jdbcUrl, jdbcDriver (driver class name), and jdbcUsername (and jdbcPassword).
- Verify the property placeholders resolve in the active Spring profile (log the bound values at startup).
- Alternatively inject a DataSource bean or use dataSourceJndiName to bypass JDBC-property requirements.
Example fix
// before
cfg.setJdbcUrl("jdbc:dm://localhost:5236");
// driver and username missing
// after
cfg.setJdbcUrl("jdbc:dm://localhost:5236")
.setJdbcDriver("dm.jdbc.driver.DmDriver")
.setJdbcUsername("SYSDBA")
.setJdbcPassword("SYSDBA001"); Defensive patterns
Strategy: validation
Validate before calling
if (cfg.getDataSource() == null && cfg.getDataSourceJndiName() == null && cfg.getJdbcUrl() != null) {
Objects.requireNonNull(cfg.getJdbcDriver(), "jdbcDriver required when jdbcUrl is set");
Objects.requireNonNull(cfg.getJdbcUsername(), "jdbcUsername required when jdbcUrl is set");
} Type guard
null
Try / catch
try { engine = cfg.buildProcessEngine(); }
catch (FlowableException e) { /* log all three jdbc props (mask password) then rethrow */ } Prevention
- Set jdbcUrl + jdbcDriver + jdbcUsername + jdbcPassword together
- Log resolved datasource properties at startup (mask password)
- Validate externalized config in each Spring profile
When it happens
Trigger: Calling configuration.setJdbcUrl(...) without setJdbcDriver(...); providing a URL but leaving username null (e.g. forgetting to inject ${spring.datasource.username}); YAML/env var not resolving so the property stays null.
Common situations: Spring Boot externalized config where one of the datasource.* properties is missing in a profile; copy-paste config that drops the driver class.
Related errors
- couldn't lookup datasource from {}: {}
- couldn't deduct database type from database product name '{}
- invalid command interceptor chain configuration: {}
- Error while building ibatis SqlSessionFactory: {}
- Exception while initializing Database connection
AI-assisted analysis of YunaiV/ruoyi-vue-pro@0418084e22 (2026-08-14).
Data as JSON: /api/errors/20289fecc6319974.
Report an issue: GitHub.