报This application has no explicit mapping for /error, so you are seeing this as a fallback解决方法
Posted 秋9
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了报This application has no explicit mapping for /error, so you are seeing this as a fallback解决方法相关的知识,希望对你有一定的参考价值。
【现象】SpringBoot项目中访问已经存在的url时,报如下错误:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sun Dec 04 12:05:36 CST 2022
There was an unexpected error (type=Not Found, status=404).
【解决方法】
SpringBoot项目中的解决方法
启动类中添加scanBasePackages,具体举例如下:
修改前为:
@SpringBootApplication public class DemoApplication public static void main(String[] args) SpringApplication.run(DemoApplication.class, args);
修改后为:
@SpringBootApplication(scanBasePackages="com.digest")
public class DemoApplication
public static void main(String[] args)
SpringApplication.run(DemoApplication.class, args);
以上是关于报This application has no explicit mapping for /error, so you are seeing this as a fallback解决方法的主要内容,如果未能解决你的问题,请参考以下文章
报This application has no explicit mapping for /error, so you are seeing this as a fallback解决方法
报This application has no explicit mapping for /error, so you are seeing this as a fallback解决方法
springboot:This application has no explicit mapping for /erro
Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as