{"record":{"id":"20289fecc6319974","repo":"YunaiV/ruoyi-vue-pro","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/ruoyi-vue-pro/blob/0418084e222612af2fc1141f566af454f9236ab1/sql/dm/flowable-patch/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java#L433-L469","documentation":"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.","triggerScenarios":"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.","commonSituations":"Spring Boot externalized config where one of the datasource.* properties is missing in a profile; copy-paste config that drops the driver class.","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."],"exampleFix":"// before\ncfg.setJdbcUrl(\"jdbc:dm://localhost:5236\");\n// driver and username missing\n// after\ncfg.setJdbcUrl(\"jdbc:dm://localhost:5236\")\n    .setJdbcDriver(\"dm.jdbc.driver.DmDriver\")\n    .setJdbcUsername(\"SYSDBA\")\n    .setJdbcPassword(\"SYSDBA001\");","handlingStrategy":"validation","validationCode":"if (cfg.getDataSource() == null && cfg.getDataSourceJndiName() == null && cfg.getJdbcUrl() != null) {\n    Objects.requireNonNull(cfg.getJdbcDriver(), \"jdbcDriver required when jdbcUrl is set\");\n    Objects.requireNonNull(cfg.getJdbcUsername(), \"jdbcUsername required when jdbcUrl is set\");\n}","typeGuard":"null","tryCatchPattern":"try { engine = cfg.buildProcessEngine(); }\ncatch (FlowableException e) { /* log all three jdbc props (mask password) then rethrow */ }","preventionTips":["Set jdbcUrl + jdbcDriver + jdbcUsername + jdbcPassword together","Log resolved datasource properties at startup (mask password)","Validate externalized config in each Spring profile"],"tags":["flowable","datasource","jdbc","configuration"],"backgroundTag":null,"analyzedSha":"0418084e222612af2fc1141f566af454f9236ab1","analyzedAt":"2026-08-14T00:56:18.412Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}