I. Error Prompt:
Ii. Reasons:
Iii. Solution 1: Package of the mobile control layer:
4. Solution 2: Add @SpringBootApplication(scanBasePackages=” Controller “)
5. Summarize the reasons for possible errors:
Reason 1:
Reason 2:
Reason 3:
Vi. Cause of Error of Eclipse starting Springboot:
An error was reported when Springboot was running, other configurations were fine, and after a long look I found the cause.
I. Error Prompt:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Jun 24 14:56:23 CST 2019
There was an unexpected error (type=Not Found, status=404).
No message available
Ii. Reasons:
Problem with IDEA directory structure, the location of the Application startup class is wrong. To place the Application class on the outermost side, it contains all the subpackages. And my Controller is in the outermost package. The page could not be found.
Iii. Solution 1: Package of the mobile control layer:
Move the Controller class in, and it will run successfully.
Refresh again and the page will open successfully.
4. Solution 2: Add @SpringBootApplication(scanBasePackages=” Controller “)
In your Demo01Application class that you started, add a comment specifying the location of your Controller, and you can specify the load and solve the problem successfully.
package com.hh.demo01;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages="controller")
public class Demo01Application {
public static void main(String[] args) {
SpringApplication.run(Demo01Application.class, args);
}
}
5. Summarize the reasons for possible errors:
This exception indicates that the url for the jump page has no corresponding value.
Reason 1:
The Application startup class is not in the right place. To place the Application class on the outermost side, it contains all subpackages
reason :spring-boot automatically loads all components under the package where the startup class is located and under its subpackages.
Reason 2:
In springboot configuration file: application. Yml or application. The properties on the view of the parser configuration problem:
when the spring under the pom file – the boot – starter – paren version used when high:
spring. MVC. The prefix/spring. MVC. The suffix
As spring under the pom file – the boot – starter – paren version low when use:
spring. The prefix/spring. The suffix
Reason 3:
Controller URL path writing problem
@RequestMapping(” XXXXXXXXXXXXXX “)
actual access path and “XXX” does not conform.
Refer to the article: https://www.cnblogs.com/lilinzhiyu/p/7921890.html
Vi. Cause of Error of Eclipse starting Springboot:
When the eclipse deployed project is launched, This application has no explicit mapping for /error, so you are seeing This as a fallback. At the same time, his log shows port 8080 being started.
And my configuration file has configured the port:
Later, it turned out that it was also because of the location of the package, that is, the above reason 1: the location of the Application startup class is wrong. To place the Application class on the outermost side, you include all subpackages because Spring-Boot automatically loads all components under the package where the startup class is located and under its subpackages.
After changing the position, it starts successfully, and the port is correct and the page is opened correctly.
Personal Summary:
I’m going to have to do some careful checking.
Read More:
- Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:
- Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded (How to Fix)
- Android Studio: Application Installation Failed (How to Fix)
- You may need an appropriate loader to handle this file type, currently no loaders are configured to
- UnhandledPromiseRejectionWarning Error: Can‘t set headers after they are sent (How to Fix)
- How to Fix ubuntu phpmyadmin error: “Connection for controluser as defined in your configuration failed”
- Module build failed Error Plugin/Preset files are not allowed to export objects, only functions (How to Fix)
- How to Fix error: ‘for’ loop initial declarations are only allowed in C99 mode
- VScode: How to Fix “Comments are not permitted in JSON” issue
- It will appear as soon as it is turned on BTServer.exe -Application error (0xc0150002)
- Problem solving: this application cannot run under a virtual machine arcmapr, but you are not using a virtual machine
- nbconvert failed: xelatex not found on PATH, if you have not installed xelatex you may need to do so
- How to Fix IDM has been Registered with a Fake Serial Number
- How to Fix webpack Module build failed Error: The node API for ‘babel’ has been moved to babel-core
- Error reporting: attributeerror: module ‘******* has no attribute’ ******* and other problems are solved
- yaml.scanner.ScannerError: mapping values are not allowed here
- Docker encountered a problem 4: yaml: Line 1: mapping values are not allowed in this context
- How to Fix NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.
- El expressions are not parsed and output as is
- Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory (How to Fix)