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
Method 1: build application under other packages
Method 2: add @ componentscan annotation on the application class to specify the package to scan
- An error is reported when springboot starts: error creating bean with name ‘XXXX’
- Field userrepository in com.example.demo2.service.imp.UserServiceImp required a bean of type ‘com.ex
- Solve the problem that springboot does not scan @ repository
- Common forms of springboot2. X boot class location
- Springboot project startup exception – required a single bean, but 2 were found
- This application has no explicit mapping for /error, so you are seeing this as a fallback (How to Fix)
- spring boot Whitelabel Error Page
- Start tomcat server error Context initialization failed
- Why not manage controller in spring container
- Solution to the error of @ resource annotation in eclipse spring
- Solution of redisconnection factory in springboot2 not Autowired
- Using global timing task cronutil in hutool tool class
- Springboot startup error: error starting ApplicationContext
- Error: Could not find or load main class ***
- Springboot starts, closes, and restarts scripts as jar packages
- Spring integrates JUnit configuration
- Springboot error: property ‘sqlsessionfactory’ or ‘sqlsessiontemplate’ are required error details
- [solved] closingontransa ctionalSqlSessionorg.apache.ibatis . session.defaults.DefaultSqlSession @20] No information after that.
- tomcat Issues org.apache.catalina.LifecycleException: Failed to start component
- Error creating bean with name ‘enablererediskeyspacenotificationsinitializer’