Spring-Boot "Whitelabel Error Page" 解决方法总结

初学Spring-Boot, "Whitelabel Error Page"是很多人碰到的第一个头痛的问题

Whitelabel Error Page

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

Fri Apr 09 13:02:50 CST 2017
There was an unexpected error (type=Internal Server Error, status=500).
No message available

这一般是因为,通过Application无法找到controller造成的。

解决方式如下:

1. Application中需要在包结构的最上层
2. Application中引入注解,并加上Controller的包目录 @ComponentScan(basePackages= {"org.xxxx.ad.controller"})
3. Application上加入注解@SpringBootApplication
4.  Application扩展SpringBootServletInitializer
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值