使用SpringCloud的Feign访问时报错?
spring吧
全部回复
仅看楼主
level 1
Lemon🐵🍀 楼主
@FeignClient(value = "service-hi")
public interface SchedualServiceHi {
@RequestMapping(value = "/hi",method = RequestMethod.GET)
String sayHiFromClientOne(@RequestParam(value = "name") String name);
}
@RestController
public class HiController {
@Autowired
SchedualServiceHi schedualServiceHi;
@RequestMapping(value = "/hi",method = RequestMethod.GET)
public String sayHi(@RequestParam String name){
return schedualServiceHi.sayHiFromClientOne(name);
}
}
报错信息:
feign.FeignException: status 404 reading SchedualServiceHi#sayHiFromClientOne(String); content:
{"timestamp":"2018-08-07T02:50:39.831+0000","status":404,"error":"Not Found","message":"No message available","path":"/hi"}
2018年08月07日 02点08分 1
level 1
你的yml有没有设置url路径
2018年08月08日 07点08分 2
level 1
楼主问题解决 我这两天被这个问题困扰了很旧 明明是书上标准的例子 网上的方法也都没试对
2019年04月29日 12点04分 3
feign 接口的 参数类型和参数名称与提供接口的controller中的方法的参数名称和类型对应不上
2019年05月05日 07点05分
level 1
楼主是怎么解决的啊,我刚学springboot也遇到这个问题,不知道为什么
2019年09月27日 09点09分 4
1