YunaiV/yudao-cloud · 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

In initDataSource(), when jdbcUrl is set Flowable requires jdbcDriver and jdbcUsername as well; if either is null it throws immediately. jdbcPassword is optional (empty-password databases), but driver and username are mandatory.

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 477be9dd49)

Solutions

  1. Set all three: setJdbcUrl, setJdbcDriver, setJdbcUsername (and setJdbcPassword if needed).
  2. Check property spelling/prefix in the config file (e.g. flowable.database-driver, flowable.database-username in Spring Boot starter).
  3. Alternatively provide the DataSource directly via setDataSource(dataSource) and leave all jdbc* fields null.
  4. Log or assert the three values are non-null before buildProcessEngine().

Example fix

# before
flowable.jdbc-url=jdbc:dm://localhost:5236

# after
flowable.jdbc-url=jdbc:dm://localhost:5236
flowable.jdbc-driver=dm.jdbc.driver.DmDriver
flowable.jdbc-username=SYSDBA
flowable.jdbc-password=***
Defensive patterns

Strategy: validation

Validate before calling

Assert.hasText(cfg.getJdbcUrl(), "jdbcUrl required");
Assert.hasText(cfg.getJdbcDriver(), "jdbcDriver required");
Assert.hasText(cfg.getJdbcUsername(), "jdbcUsername required");
// now safe: buildProcessEngine()

Prevention

When it happens

Trigger: Configuration sets setJdbcUrl(...) but never setJdbcDriver(...) or setJdbcUsername(...); or properties flowable.jdbcurl is defined in a properties file while flowable.jdbcdriver/flowable.jdbcusername lines are missing or misspelled.

Common situations: Copy-paste config where only the URL line is updated; property-name mismatches (jdbcUrl vs jdbc-url in Spring Boot relaxed binding while Flowable expects exact setters); switching from a DataSource bean to JDBC URL config and forgetting the driver.

Related errors


AI-assisted analysis of YunaiV/yudao-cloud@477be9dd49 (2026-08-14). Data as JSON: /api/errors/e8db7c3aea6755df. Report an issue: GitHub.