欢迎访问Spring Cloud中国社区

我们致力于成为中国最专业的Spring Boot和Spring Cloud交流社区。推荐使用Github直接登录,欢迎加微信号Software_King进入社区微信交流群。国内谁在使用Spring Cloud?欢迎登记

SpringCloud使用Feign访问URL出现404

yangyangwang · 1月前 · 534 ·

SpringCloud使用Feign访问URL出现404

这个是feign 接口

  1. @FeignClient(value = "MICROSERVICECLOUD-DEPT")
  2. public interface DeptClientService {
  3. @RequestMapping(value = "/consumer/dept/get/{id}", method = RequestMethod.GET)
  4. public Dept get(@PathVariable("id") Long id);
  5. @RequestMapping(value = "/consumer/dept/list", method = RequestMethod.GET)
  6. public List<Dept> list();
  7. @RequestMapping(value = "/consumer/dept/add", method = RequestMethod.POST)
  8. public boolean add(Dept dept);
  9. }

在访问 http://localhost/consumer/dept/list 出现
报错信息

  1. feign.FeignException: status 404 reading DeptClientService#list(); content:
  2. {"timestamp":1534497184976,"status":404,"error":"Not Found","message":"Not Found","path":"/consumer/dept/list"}


注册中心已经注册服务