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:
- Springboot Error: Failed to configure a DataSource: ‘url’ attribute is not specified and no embedd
- Two ways to implement Spring Boot’s scanmapper interface class
- Spring cloud uses feignclient to start and report an error
- [Solved] Spring Boot Error: “jdbcUrl is required with driverClassName.”
- SpringBoot Frame: Failed to determine a suitable driver class [How to Solve]
- How to Solve Cannot determine embedded database driver class for database type NONE
- Solution to the problem of consider defining a bean of type ‘xxx’ in your configuration in spring boot auto injection
- Container Cannot Find bean, Field usersMapper in com.imooc.impl.UserServiceImpl required a bean of type ‘com.imooc.mapper.UsersMapper’ that could not be found.
- [Solved] Spring Cloud Gateway Startup Error: Parameter 0 of method modifyRequestBodyGatewayFilterFactory in…
- How hibernate 3 used in jbpm4.4 is compatible with spring 5.X and the exception caused by: java.lang.classnotfoundexception: org.hibernate.impl.sessionimpl