問題描述
Spring Cloud Feign調用其它服務報錯,錯誤提示如下:Failed to instantiate [java.util.List]: Specified class is an interface。
解決方案
通過查詢一些資料,得到的結論,是定義接口傳遞的參數時,沒有用@RequestBody修飾,檢視定義接口有用@RequestBogy修飾,Feign的接口實作裡沒有用@RequestBody修飾,添加後問題就解決了,以後還是要仔細看待每個問題。
Spring Cloud Feign調用其它服務報錯,錯誤提示如下:Failed to instantiate [java.util.List]: Specified class is an interface。
通過查詢一些資料,得到的結論,是定義接口傳遞的參數時,沒有用@RequestBody修飾,檢視定義接口有用@RequestBogy修飾,Feign的接口實作裡沒有用@RequestBody修飾,添加後問題就解決了,以後還是要仔細看待每個問題。