改造order服务为多模块后,联调下单时报错404.

来源:5-9 项目改造成多模块

蛋蛋_JL

2019-12-11

改造order服务为多模块后,联调下单,order调用productClient去查询商品【productClient.listForOrder(productIdList)】的时候 时报错404

  • postman返回的接口信息
    图片描述
  • 控制台具体报错如下:
  • 2019-12-11 10:12:51.815 ERROR 22368 — [scoveryClient-1] c.netflix.discovery.TimedSupervisorTask : task supervisor timed out

java.util.concurrent.TimeoutException: null
at java.util.concurrent.FutureTask.get(FutureTask.java:205) [na:1.8.0_151]
at com.netflix.discovery.TimedSupervisorTask.run(TimedSupervisorTask.java:63) ~[eureka-client-1.7.0.jar:1.7.0]
at java.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511)[na:1.8.0151]atjava.util.concurrent.FutureTask.runRunnableAdapter.call(Executors.java:511) [na:1.8.0_151] at java.util.concurrent.FutureTask.runRunnableAdapter.call(Executors.java:511)[na:1.8.0151]atjava.util.concurrent.FutureTask.run$capture(FutureTask.java:266)[na:1.8.0151]atjava.util.concurrent.FutureTask.run(FutureTask.java)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutorcapture(FutureTask.java:266) [na:1.8.0_151] at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutorcapture(FutureTask.java:266)[na:1.8.0151]atjava.util.concurrent.FutureTask.run(FutureTask.java)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.access201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]

2019-12-11 10:12:51.815 ERROR 22368 — [scoveryClient-0] c.netflix.discovery.TimedSupervisorTask : task supervisor timed out

java.util.concurrent.TimeoutException: null
at java.util.concurrent.FutureTask.get(FutureTask.java:205) [na:1.8.0_151]
at com.netflix.discovery.TimedSupervisorTask.run(TimedSupervisorTask.java:63) ~[eureka-client-1.7.0.jar:1.7.0]
at java.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511)[na:1.8.0151]atjava.util.concurrent.FutureTask.runRunnableAdapter.call(Executors.java:511) [na:1.8.0_151] at java.util.concurrent.FutureTask.runRunnableAdapter.call(Executors.java:511)[na:1.8.0151]atjava.util.concurrent.FutureTask.run$capture(FutureTask.java:266)[na:1.8.0151]atjava.util.concurrent.FutureTask.run(FutureTask.java)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutorcapture(FutureTask.java:266) [na:1.8.0_151] at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutorcapture(FutureTask.java:266)[na:1.8.0151]atjava.util.concurrent.FutureTask.run(FutureTask.java)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.access201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0151]atjava.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException: status 404 reading ProductClient#listForOrder(List); content:
{“timestamp”:1576030376731,“status”:404,“error”:“Not Found”,“message”:“No message available”,“path”:"/product/listForOrder"}] with root cause

feign.FeignException: status 404 reading ProductClient#listForOrder(List); content:
{“timestamp”:1576030376731,“status”:404,“error”:“Not Found”,“message”:“No message available”,“path”:"/product/listForOrder"}
at feign.FeignException.errorStatus(FeignException.java:62) ~[feign-core-9.5.0.jar:na]
at feign.codec.ErrorDecoderDefault.decode(ErrorDecoder.java:91) [feign−core−9.5.0.jar:na]atfeign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:138) [feign−core−9.5.0.jar:na]atfeign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76) [feign−core−9.5.0.jar:na]atfeign.ReflectiveFeignDefault.decode(ErrorDecoder.java:91) ~[feign-core-9.5.0.jar:na] at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:138) ~[feign-core-9.5.0.jar:na] at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76) ~[feign-core-9.5.0.jar:na] at feign.ReflectiveFeignDefault.decode(ErrorDecoder.java:91) [feigncore9.5.0.jar:na]atfeign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:138) [feigncore9.5.0.jar:na]atfeign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76) [feigncore9.5.0.jar:na]atfeign.ReflectiveFeignFeignInvocationHandler.invoke(ReflectiveFeign.java:103) ~[feign-core-9.5.0.jar:na]
at com.sun.proxy.Proxy103.listForOrder(UnknownSource) [na:na]atcom.imooc.order.service.impl.OrderServiceImpl.create(OrderServiceImpl.java:53) [classes/:na]atcom.imooc.order.service.impl.OrderServiceImplProxy103.listForOrder(Unknown Source) ~[na:na] at com.imooc.order.service.impl.OrderServiceImpl.create(OrderServiceImpl.java:53) ~[classes/:na] at com.imooc.order.service.impl.OrderServiceImplProxy103.listForOrder(UnknownSource) [na:na]atcom.imooc.order.service.impl.OrderServiceImpl.create(OrderServiceImpl.java:53) [classes/:na]atcom.imooc.order.service.impl.OrderServiceImplFastClassBySpringCGLIBFastClassBySpringCGLIBFastClassBySpringCGLIB$934acba0.invoke() ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]

写回答

1回答

廖师兄

2019-12-11

说明链接 /product/listForOrder 就是404,springcloud不要用新版本,新版本变动在课程最后讲了

0
5
weixin_慕前端8300594
回复
蛋蛋_JL
你好,我也有同样的错误,请问你是在加的代码
2019-12-30
共5条回复

SpringCloud Finchley(M2+RELEASE+SR2)微服务实战

SpringCloud组件实现微服务,【已升级Finchley.Release】

5668 学习 · 2489 问题

查看课程