{"record":{"id":"e8db7c3aea6755df","repo":"YunaiV/yudao-cloud","slug":"datasource-or-jdbc-properties-have-to-be-specified","errorCode":null,"errorMessage":"DataSource or JDBC properties have to be specified in a process engine configuration","messagePattern":"DataSource or JDBC properties have to be specified in a process engine configuration","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"critical","filePath":"sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java","lineNumber":451,"sourceCode":"    protected void initEngineConfigurations() {\n        addEngineConfiguration(getEngineCfgKey(), getEngineScopeType(), this);\n    }\n\n    // DataSource\n    // ///////////////////////////////////////////////////////////////\n\n    protected void initDataSource() {\n        if (dataSource == null) {\n            if (dataSourceJndiName != null) {\n                try {\n                    dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName);\n                } catch (Exception e) {\n                    throw new FlowableException(\"couldn't lookup datasource from \" + dataSourceJndiName + \": \" + e.getMessage(), e);\n                }\n\n            } else if (jdbcUrl != null) {\n                if ((jdbcDriver == null) || (jdbcUsername == null)) {\n                    throw new FlowableException(\"DataSource or JDBC properties have to be specified in a process engine configuration\");\n                }\n\n                logger.debug(\"initializing datasource to db: {}\", jdbcUrl);\n\n                if (logger.isInfoEnabled()) {\n                    logger.info(\"Configuring Datasource with following properties (omitted password for security)\");\n                    logger.info(\"datasource driver : {}\", jdbcDriver);\n                    logger.info(\"datasource url : {}\", jdbcUrl);\n                    logger.info(\"datasource user name : {}\", jdbcUsername);\n                }\n\n                PooledDataSource pooledDataSource = new PooledDataSource(this.getClass().getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword);\n\n                if (jdbcMaxActiveConnections > 0) {\n                    pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections);\n                }\n                if (jdbcMaxIdleConnections > 0) {\n                    pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections);","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/YunaiV/yudao-cloud/blob/477be9dd49ab7223a972a6abdff0684d6423dec3/sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java#L433-L469","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set all three: setJdbcUrl, setJdbcDriver, setJdbcUsername (and setJdbcPassword if needed).","Check property spelling/prefix in the config file (e.g. flowable.database-driver, flowable.database-username in Spring Boot starter).","Alternatively provide the DataSource directly via setDataSource(dataSource) and leave all jdbc* fields null.","Log or assert the three values are non-null before buildProcessEngine()."],"exampleFix":"# before\nflowable.jdbc-url=jdbc:dm://localhost:5236\n\n# after\nflowable.jdbc-url=jdbc:dm://localhost:5236\nflowable.jdbc-driver=dm.jdbc.driver.DmDriver\nflowable.jdbc-username=SYSDBA\nflowable.jdbc-password=***","handlingStrategy":"validation","validationCode":"Assert.hasText(cfg.getJdbcUrl(), \"jdbcUrl required\");\nAssert.hasText(cfg.getJdbcDriver(), \"jdbcDriver required\");\nAssert.hasText(cfg.getJdbcUsername(), \"jdbcUsername required\");\n// now safe: buildProcessEngine()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the jdbc triple in a @PostConstruct/configuration check so misconfig fails at boot with a clear message","Keep driver/username/password adjacent in config files so updating one reminds about the others"],"tags":["flowable","datasource","jdbc","configuration"],"backgroundTag":null,"analyzedSha":"477be9dd49ab7223a972a6abdff0684d6423dec3","analyzedAt":"2026-08-14T13:35:31.121Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}