Whitelabel Error Page...报错

在Eclipse中安装好STS插件这里写链接内容
新建了一个简单的spring boot demo项目
Whitelabel Error Page...报错_第1张图片
然后启动运行成功


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.4.RELEASE)

2018-09-01 14:29:21.714  INFO 8324 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication on ThinkPad-PC with PID 8324 (D:\worksplace\demo\target\classes started by ThinkPad in D:\worksplace\demo)
2018-09-01 14:29:21.719  INFO 8324 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
2018-09-01 14:29:21.832  INFO 8324 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@589b3632: startup date [Sat Sep 01 14:29:21 CST 2018]; root of context hierarchy
2018-09-01 14:29:24.494  INFO 8324 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-09-01 14:29:24.552  INFO 8324 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-09-01 14:29:24.553  INFO 8324 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-09-01 14:29:24.566  INFO 8324 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\tools\jdk1.8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_121/bin/server;C:/Program Files/Java/jre1.8.0_121/bin;C:/Program Files/Java/jre1.8.0_121/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Java\jdk-10.0.1\bin;C:\Java\jdk-10.0.1\jre\bin;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\tools\Git\cmd;C:\tools\nodejs\;C:\Users\ThinkPad\AppData\Roaming\npm;D:\tools\eclipse;;.]
2018-09-01 14:29:24.742  INFO 8324 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-09-01 14:29:24.743  INFO 8324 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2915 ms
2018-09-01 14:29:24.874  INFO 8324 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-09-01 14:29:24.881  INFO 8324 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-09-01 14:29:24.882  INFO 8324 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-09-01 14:29:24.882  INFO 8324 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-09-01 14:29:24.882  INFO 8324 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-09-01 14:29:25.090  INFO 8324 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-01 14:29:25.427  INFO 8324 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@589b3632: startup date [Sat Sep 01 14:29:21 CST 2018]; root of context hierarchy
2018-09-01 14:29:25.555  INFO 8324 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-09-01 14:29:25.557  INFO 8324 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-09-01 14:29:25.598  INFO 8324 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-01 14:29:25.599  INFO 8324 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-01 14:29:25.891  INFO 8324 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-09-01 14:29:25.970  INFO 8324 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2018-09-01 14:29:25.976  INFO 8324 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 4.804 seconds (JVM running for 5.479)
2018-09-01 14:29:33.418  INFO 8324 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2018-09-01 14:29:33.419  INFO 8324 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
2018-09-01 14:29:33.451  INFO 8324 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet     

然后访问页面发现Whitelabel Error Page…报错
Whitelabel Error Page...报错_第2张图片
最后找呀找呀,终于被某人告知,springboot的默认机制,必须是com.example.demo.xx下,要不然的话 就扫描不到报错
然后我就修改:
Whitelabel Error Page...报错_第3张图片
再次运行页面发现成功了
Whitelabel Error Page...报错_第4张图片
到此结束

你可能感兴趣的:(Spring,Boot)