做了个简单的springboot项目,一开始所有运行正常,之后写了一天的代码,再运行相同的代码,就一直报以下异常:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Apr 07 13:02:50 CST 2017
There was an unexpected error (type=Internal Server Error, status=500).
No message available
造成的原因其实很简单,就是你的运行的主方法没在最外层,
controller要写在Application所对应的包下面才可以。因为spring只会扫描主类包下面所有的class
controller要写在Application所对应的包下面才可以。因为spring只会扫描主类包下面所有的class

Application的类一定要写在最外成,最次也要跟你的controller在同一级目录,这是SpringBoot的启动顺序决定的,也算是SpringBoot的一个小问题,很容易解决的。