status 404 reading EduClient#getCourseInfoOrder(String)解决过程

UcenterClient#getUserInfoOrder(String) failed and no fallback available.解决过程

报错内容:

com.netflix.hystrix.exception.HystrixRuntimeException: UcenterClient#getUserInfoOrder(String) failed and no fallback available.
at com.netflix.hystrix.AbstractCommand$22.call(AbstractCommand.java:822)
at com.netflix.hystrix.AbstractCommand$22.call(AbstractCommand.java:807)
at rx.internal.operators.OperatorOnErrorResumeNextViaFunction(4.onError(OperatorOnErrorResumeNextViaFunction.java:140) at rx.internal.operators.OnSubscribeDoOnEach)DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)

(Caused by: feign.FeignExceptionNotFound: status 404 reading EduClient#getCourseInfoOrder(String) at feign.FeignException.clientErrorStatus(FeignException.java:165) at feign.FeignException.errorStatus(FeignException.java:141) at feign.FeignException.errorStatus(FeignException.java:133) at feign.codec.ErrorDecoderDefault.decode(ErrorDecoder.java:92))

报错界面:

报错原因:

看报错部分,后面的Caused by: feign.FeignExceptionNotFound大概意思是某个东西没找到,那么可能有以下几种情形:

1.配置文件中部分信息没扫描到

2.远程调用模块时,注解什么的有问题,没找到要调用的模块

3.地址有问题,例如Controller上的path,以及方法上的path,按照这个思路去找

解决流程:

一、检查client部分:

@Component
@FeignClient("service-edu")
public interface EduClient {
    //根据课程id查询课程信息
 @PostMapping("/eduservice/coursefront/getCourseInfoOrder/{id}")
    public CourseWebVoOrder getCourseInfoOrder(@PathVariable("id") String id);
}

检查被调用module的配置文件,主要检查spring.application.name是否一致:

二、检查Controller上面的path以及Method上面的Path

可以中间设置断点,或者加一些打印语句,判断进入情况.

原文地址:https://www.cnblogs.com/Courage129/p/14044914.html