使用Eureka中遇到的一些问题


1.情况 :

  服务已经注册到eureka,eureka中可以看到,但是 consumer和provider这两个服务,一直报错,
错误信息:DiscoveryClient_CONSUMER-DEMO/XXXX:consumer-demo:8080 - was unable to refresh its cache! status = Cannot execute request on any known server
  解决方法:检查eureka配置文件中下面这段配置

eureka:
  client:
    service-url:
      defaultZone: http://localhost:10086/eureka

这段代码,建议重写,或者从别的项目中复制一份过来

2.情况:

  错误信息:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Requestprocessingfailed;nestedexceptionisorg.springframework.web.client.HttpClientErrorException$NotFound: 404 null] with root cause
从中我们可以看到,404请求路径中出现问题,
  解决方法:进入dubug,检查controller调用servcie的路径与请求路径是否相同


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM