1. 程式人生 > >spring-boot啟動報錯:This application has no explicit mapping for /error, so you are seeing this as a fal

spring-boot啟動報錯:This application has no explicit mapping for /error, so you are seeing this as a fal

1、報錯資訊:

  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 2016   There was an unexpected error (type=Not Found, status=404).    No message available

2、原因:

      沒有找到要載入的路勁

2、解決方法:

     原因是【Application啟動類放的位置不對】要將Application放在最外層,也就是要包含所有子包。

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

請參考以下結論:spring-boot會自動載入啟動類所在包下及其子包下的所有元件.