报错代码:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘orderController’: Unsatisfied dependency expressed through field ‘orderService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘orderServiceImpl’: Unsatisfied dependency expressed through field ‘goodsApiAgent’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.dome.order.agent.GoodsApiAgent’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Method has too many Body parameters: public abstract java.lang.Boolean com.dome.order.agent.GoodsApiAgent.removeCart(java.lang.String,java.lang.String)
问题描述:
报错位置:
@PostMapping("/goods/l/removeCart")
Boolean removeCart(String userId, String goodsId);
报错截图:
原因分析:
原因:Method has too many Body parameters(post方法的主体参数太多)
解决方案:
在方法参数上添加注解@RequestParam
修改后:
@PostMapping("/goods/l/removeCart")
Boolean removeCart(@RequestParam String userId, @RequestParam String goodsId);
测试发现问题解决


![[BUG10001]:Fegin远程调用报错 [BUG10001]:Fegin远程调用报错](http://www.mshxw.com/aiimages/31/749373.png)
