{"record":{"id":"c81eea08a63073f1","repo":"flowable/flowable-engine","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":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java","lineNumber":431,"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":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java#L413-L449","documentation":"When neither a DataSource nor a JNDI name is configured, the engine falls back to building a datasource from JDBC properties. If jdbcUrl is set but jdbcDriver or jdbcUsername is missing, configuration cannot proceed and this FlowableException is thrown.","triggerScenarios":"AbstractEngineConfiguration.initDataSource() with dataSource == null, dataSourceJndiName == null, jdbcUrl != null, and either jdbcDriver == null or jdbcUsername == null.","commonSituations":"Incomplete spring/boot config (only url given), missing properties file entries, renaming config keys after upgrade, forgetting to set credentials for the JDBC connection.","solutions":["Set jdbcDriver (fully qualified driver class name) and jdbcUsername (and jdbcPassword) alongside jdbcUrl","Or provide a javax.sql.DataSource directly via setDataSource()","Or configure dataSourceJndiName if running in an app server"],"exampleFix":"// before\nconfig.setJdbcUrl(\"jdbc:h2:mem:flowable\");\n// after\nconfig.setJdbcUrl(\"jdbc:h2:mem:flowable\");\nconfig.setJdbcDriver(\"org.h2.Driver\");\nconfig.setJdbcUsername(\"sa\");\nconfig.setJdbcPassword(\"\");","handlingStrategy":"validation","validationCode":"if (config.getDataSource() == null && config.getDataSourceJndiName() == null && config.getJdbcUrl() != null) { requireNonNull(config.getJdbcDriver(), \"jdbcDriver required\"); requireNonNull(config.getJdbcUsername(), \"jdbcUsername required\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure url+driver+username+password as a set","Use a checked config builder/properties validation at startup","Centralize engine config in one class so JDBC props cannot be partially set"],"tags":["flowable","jdbc","datasource","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}