Spring Cloud Feign(报错1)
2021-01-14 15:14
标签:cloud 服务 修改 eating beans com lan param ror 使用Feign组件进行远程服务的调用的时候,报错信息如下 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.example.eurekaclient1.feign.UserFeignClient‘: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param 0. Caused by: java.lang.IllegalStateException: PathVariable annotation was empty on param 0. Feign接口中的代码如下: 修改之后不报错 记录:Feign组件进行HTTP调用的时候,如果路径中有@PathVariable,则需指明param。 Spring Cloud Feign(报错1) 标签:cloud 服务 修改 eating beans com lan param ror 原文地址:https://www.cnblogs.com/wypzpz/p/12940806.html@FeignClient(value = "eureka-client1")
public interface UserFeignClient {
@RequestMapping("/test/findById/{id}")
public User findById(@PathVariable int id);
}@FeignClient(value = "eureka-client1")
public interface UserFeignClient {
@RequestMapping("/test/findById/{id}")
public User findById(@PathVariable(value = "id") int id);
}
下一篇:java web项目搭建
文章标题:Spring Cloud Feign(报错1)
文章链接:http://soscw.com/index.php/essay/41837.html