Description:
Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 1
Reason:
Spring boot loads the org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration class by default, after introducing mybatis-spring-boot-starter in the pom. DataSourceAutoConfiguration class uses the @Configuration annotation to inject the dataSource bean into spring because there is no configuration information about the dataSource in the project, so when spring creates the dataSource bean due to the lack of relevant information it will report an error.
Solution:
Add attribute @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) to the Spring boot boot boot class to prevent Spring boot from automatically injecting the dataSource
Read More:
- How to Solve Application failed to start error
- [Solved] SpringBoot Project Start Error: No bean named ‘org.springframework.context.xxxxx.importRegistry‘ available
- [Solved] SpringBoot Integrates Swagge Error: Failed to start bean ‘documentationPluginsBootstrapper‘
- [Solved] integrated swagger Start Error: Failed to start bean ‘documentationPluginsBootstrapper‘;
- SpringBoot High Version Import Swagger 2.9.2 Error: ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper‘
- [Solved] PySide2 Error: This application failed to start because no Qt platform plugin could be initialized
- [Solved] Bat starts springboot project error: ERROR org.springframework.boot.SpringApplication -Application run failed
- Springboot running shows application run failed [How to Solve]
- [Solved] IDEA Start Project Error: Abnormal build process termination:Could not create the Java Virtual Machine.
- [Solved] Springboot Error: org.apache.catalina.core.ContainerBase : A child container failed during start
- SpringBoot startup error Failed to determine a suitable driver class
- [Solved] UNABLE TO START SERVLETWEBSERVERAPPLICATIONCONTEXT DUE TO MISSING SERVLETWEBSERVERFACTORY BEAN
- [Solved] Swagger Startup Error: Failed to start bean ‘documentationPluginsBootstrapper‘
- Error while trying to run project:unable to start debugging.the debugger is not properly installed. run setup to install or repa
- How to Solve Hyperf Failed to Start Error After Aliyun ACM Installed
- [Solved] swagger3 Error: org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
- [Solved] KDevelop Error: Failed to specify program to start
- IDEA: How to Solve Springboot Project install Error
- [Solved] Tomcat Error: Failed to start componen
- Tomcat startup error: Failed to start component [StandardServer[8005]] solution