[Solved] Spring Boot Error: “jdbcUrl is required with driverClassName.”


After spring boot is upgraded to 2.0, an error is reported when configuring multiple data sources:

“Jdbcurl is required with driverclassname.” or cause: java.lang.illegalargumentexception: datasource or datasourceclassname or jdbcurl is required.] with root cause

The solution is as follows:

Spring boot 1.0 configures the data source as spring.datasource.url and spring.datasource.driverclassname.

Spring boot 2.0 needs to be changed to spring.datasource.jdbc-url and spring.datasource.driver-class-name

Note: use the default data source of spring boot 2.0, and configure the following spring.datasource.url and spring.datasource.driver-class-name.

Similar Posts: