1. 程式人生 > >初次學習springboot啟動時報錯

初次學習springboot啟動時報錯

按照文件配置後,在controller裡面寫方法,使用了@RestController註解,但是一直報錯如下:

Whitelabel Error Page

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

Wed Dec 14 16:35:25 CST 2016There was an unexpected error (type=Not Found, status=404).No message available

後面發展問題,啟動類SpringbootfirstApplication需要放在所有包的外面,問題解決.

比如說,你建立了很多包,com.yh.controller,com.yh.service,com.yh.entity等等,而啟動檔案放在com.yh包下,問題解決.