When IDEA starts a maven project, it fails to start and displays an error reporting:
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-12-22 09:21:42.183 ERROR 14964 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
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 classAction:
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 (the profiles local are currently active).
Cause:
The datasource related package environment is referenced, but no related configuration is performed
Solution:
1, start the class to add automatic configuration parameters: (exclude = {DataSourceAutoConfiguration.class})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class ApiserviceApplication {
public static void main(final String[] args) {
SpringApplication.run(ApiserviceApplication.class, args);
}
}
2. If the code does not use the relevant package environment, the relevant Maven package can be deleted
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-cassandra-jpa</artifactId>-->
<!-- </dependency>-->
3. If used, add relevant configurations
Read More:
- Error starting ApplicationContext. To display the conditions report re-run your application with ‘de
- Spring Boot Error starting ApplicationContext. To display the auto-configuration report re-run you
- SpringBoot—Error starting ApplicationContext. To display the auto-configuration report re-run your a
- [Solved] Idea Failed to recognize Maven and Project Error
- IDEA Create maven project error: Error running‘[org.apache.maven.pluginsmaven-archetype-pluginRELEASE
- IDEA Maven Fail to Download Dependencies Error: ERROR – #org.jetbrains.idea.maven – Cannot reconnect.
- Idea create Maven project Error: [error] no longer supports source option 1.5. Please use version 1.6 or higher, and the idea reports an error: error: Java does not support the error of release version 5
- [Solved] SpringBoot Pack Project: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources
- IDEA Create Web Project with maven Error: The desired archetype does not exista…
- IDEA was Filed to Start: error launching idea (Failed to create JVM )
- [Solved] Maven Project Packaging Error: Unable to find main class
- [Solved] IDEA Add maven Project Error: Error:(3,21)java: Package javax.servletdoes not exist
- How to Solve Error: Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- [Solved] IDEA Import springboot Project Error: Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:<unknown>
- [Solved] MVN Build Project Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test
- Maven Project Right-Click -update project Error [How to Solve]
- [Solved] Error:Maven Resources Compiler: Maven project configuration required for module ‘XX‘ isn‘t available
- [Solved] IDEA Maven Error: Cannot resolve xxx & Maven Dependencies Error
- [Solved] org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject…