[Solved] Spring Boot Startup Error: DataSourceProperties$DataSourceBeanCreationException

Error message:

Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver

Reason of error :

The @Configuration annotation injects a dataSource bean into spring. Because there is no configuration information related to dataSource in the project, when spring creates a dataSource bean, an error will be reported due to lack of relevant information.


Solution :

Add a condition @SpringBootApplication(exclude = {DataSourceAutoConfiguration. class}) to the annotation on the startup boot class of Spring boot to prevent Spring boot from automatically injecting dataSource

Similar Posts: