Springboot FeignClient启动报错:Method has too many Body parameters:

FeignClient API中定义了如下Get方法:

启动时报错如下:

exception is java.lang.IllegalStateException: Method has too many Body parameters: public abstract java.lang.String com.geoswift.twpre.fapi.TwpreRestAPI.refreshBlackList(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception

报错原因:当使用Feign时,如果发送的是get请求,那么需要在请求参数前加上@RequestParam注解修饰,Controller里面可以不加该注解修饰。

我这里的话,其实没有参数需要传入,所以直接删了就可以了。如下:

重启项目,解决。

你可能感兴趣的:(Springboot FeignClient启动报错:Method has too many Body parameters:)