springboot异常之Whitelabel Error Page解决办法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liuhuanchao/article/details/73012569

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Jun 11 09:07:08 CST 2017
There was an unexpected error (type=Not Found, status=404).
No message available

问题很像是没有访问地址不对,第一感觉以为url写的不对。


其实不是,真正的原因是【Application启动类放的位置不对】要将Application放在最外层,也就是要包含所有子包。


比如你的groupId是com.google,子包就是所谓的com.google.xxx,所以要将Application类要放在com.google包下。


springboot会自动加载启动类所在包下及其子包下的所有组件.




如果觉得我的文章或者代码对您有帮助,可以微信打赏请我喝杯咖啡。 
您的支持将鼓励我继续创作!谢谢! 


猜你喜欢

转载自blog.csdn.net/liuhuanchao/article/details/73012569