SpringCloud使用Feign注解@FeignClient服务调用报错IllegalStateException: RequestParam.value() was empty on param

Feign调用报错

 Error creating bean with name 'testController': Unsatisfied dependency expressed through field 'violationClientApi'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.cardoor.dofun.api.service.violation.ViolationClientApi': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0

 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.cardoor.dofun.api.service.violation.ViolationClientApi': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0

意思是请求的参数值不能是空的,@RequestParam注解的参数并没有成功传递

1、指定参数名称,,@RequestParam("b") int b,让参数正确传递

2、使用@pathvariable注解 来传递参数

发布了117 篇原创文章 · 获赞 17 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/Jack__iT/article/details/103418526