[problem phenomenon]
In springboot, when there is no error in the request link and the controller configuration, an error will be prompted when accessing a controller link interface:
This application has no explicit mapping for /error,so you are seeing this as a fallback
[reason]
The request cannot find the corresponding bean for processing. If there is no error in the request link and the controller configuration, it may also be the problem of springbootapplication package scanning, as follows:
By default, the @springbootapplication annotation will only the beans of this package and its sub-packages, resulting in the corresponding controller beans not being loaded into the spring container
[solution]
Scheme I:
Move all controller classes to the same level package or sub package of application class, as shown in the figure:
Scheme II:
If you don’t want to change the file location, you can specify the scanned package with the @ springbootapplication annotation:
@SpringBootApplication(scanBasePackages="com.kid")
Read More:
- SpringBoot 404 Error: Whitelabel Error Page This application has no explicit mapping for /error, so yo
- SpringBoot Project Run Page Error: Whitelabel Error Page This application has no explicit mapping for /error
- [Solved] Spring Error: This application has no explicit mapping for /error
- Springboot uses Oracle database to report property ‘sqlsessionfactory’ or ‘sqlsessiontemplate’ are required
- Springboot reports an error After adding the import annotation: application failed to start
- springboot jsp: There was an unexpected error (type=Not Found, status=404). No message available
- [Solved] SpringBoot Microservices: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded dat
- Springboot startup error “No bean named’org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available”
- Spring Boot Error starting ApplicationContext. To display the auto-configuration report re-run you
- Springboot WARNING: An illegal reflective access operation has occurred
- JAVA Error Illegal access: this web application instance has been stopped already. Could not load net.sf
- Error starting ApplicationContext. To display the conditions report re-run your application with ‘de
- Explicit and implicit conversion of Java data type
- [How to Fix]No executorfactory found to execute the application
- [Solved] IDEA springboot Startup Error: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path
- [Solved] JDK Install Error /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
- [Solved] Springboot Package jar and Startup Error: It was loaded from the following location
- Springboot controls the startup of rabbitmq through configuration files
- SpringBoot+Swagger Error: 403 Forbidden [How to Solve]
- [Solved] Springboot2.x ElasticSearch Error: availableProcessors is already set to [4], rejecting [4]