【异常】-- Method has too many Body parameters

Fegin 使用不当导致异常

报错场景

使用fegin对外暴露接口,方法书写时参数未加注解,在spring底层校验时产生异常。

异常信息描述如下

会先报创建bean异常
org.springframework.beans.factory.UnsatisfiedDependencyException
再报
java.lang.IllegalStateException
其内容为:Method has too many Body parameters

解决方法

// 在方法中的参数中加入注解@RequestParam
@GetMapping("/user/login")
public AppResponse<UserRespVo> login(@RequestParam String username,@RequestParam String password);
原文地址:https://www.cnblogs.com/erlangha/p/14414930.html