1. Problems encountered in building the springboot framework.
** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
Warning: your application context may not be started because you added comments to the default package. There is also a sentence in the stack information below that includes this meaning.
1. Reason analysis
I didn’t use @ componentscanning annotation. Why did such an annotation pop up here?
When writing a startup class (the class where the main method is located), springboot does not use @ componentscan to indicate the object scanning range. By default, it scans the objects in the package where the current startup class is located.
(Note: I didn’t add @ componentscan annotation when writing the main method, so he will scan the objects in the package where the application is located)
if the current startup class has no package, an error will be reported when starting: your ApplicationContext is unlikely to start due to a @ componentscan of the default package.
(Note: the application class written in the Java folder does not belong to any package, so the startup class has no package.)
Application is built under other packages
2. Solutions
Method 1: build application under other packages
Method 2: add @ componentscan annotation on the application class to specify the package to scan
div>
Read More:
- ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing…..
- Apache failed to start due to SSL library certificate has expired
- Oracle can’t start the database due to deleting DBF file by mistake
- Andorid: Installation failed due to invalid APK file due to version mismatch
- Error starting ApplicationContext. To display the conditions report re-run your application with ‘de
- The solution of package main extensions undefined package struts default
- ClobberError: The package ‘xxx‘ cannot be installed due to a path collision for ‘xx‘ This path alre
- Spring ApplicationContext – Resource leak: ‘context’ is never closed
- JetBrains compilation error is due to project language level
- JetBrains compilation error is due to project language level
- HTTP Error 401.1 – Unauthorized:Access is denied due to invalid credentials
- fail to start Unity Package Manager
- Error: (serious: a child container failed during start) (server component failed to start so Tomcat is unable)
- Net start mongodb failed to start: system error 5 has occurred. Access is denied
- An error is reported during Java operation due to the problem of static resource export
- Error starting ApplicationContext. To display the conditions report re run
- Failed to load ApplicationContext encountered when using mybatis plus
- Spring boot running appears java.lang.IllegalStateException : Failed to load ApplicationContext
- The scan of annotations for web application [] could not be completed due to a stackoverflower error. Possible root causes include the low setting of – XSS and illegal circular inheritance dependencies. The class hierarchy being processed is
- Spring configuration transaction, JUnit unit test error “failed to load ApplicationContext”