解决com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known

问题描述

启动SpringCloud项目的时候,报错如下:

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112) ~[eureka-client-1.9.3.jar:1.9.3]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) ~[eureka-client-1.9.3.jar:1.9.3]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator 6. e x e c u t e ( E u r e k a H t t p C l i e n t D e c o r a t o r . j a v a : 137 )   [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t c o m . n e t f l i x . d i s c o v e r y . s h a r e d . t r a n s p o r t . d e c o r a t o r . S e s s i o n e d E u r e k a H t t p C l i e n t . e x e c u t e ( S e s s i o n e d E u r e k a H t t p C l i e n t . j a v a : 77 )   [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t c o m . n e t f l i x . d i s c o v e r y . s h a r e d . t r a n s p o r t . d e c o r a t o r . E u r e k a H t t p C l i e n t D e c o r a t o r . g e t A p p l i c a t i o n s ( E u r e k a H t t p C l i e n t D e c o r a t o r . j a v a : 134 )   [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t c o m . n e t f l i x . d i s c o v e r y . D i s c o v e r y C l i e n t . g e t A n d S t o r e F u l l R e g i s t r y ( D i s c o v e r y C l i e n t . j a v a : 1051 ) [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t c o m . n e t f l i x . d i s c o v e r y . D i s c o v e r y C l i e n t . f e t c h R e g i s t r y ( D i s c o v e r y C l i e n t . j a v a : 965 ) [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t c o m . n e t f l i x . d i s c o v e r y . D i s c o v e r y C l i e n t . < i n i t > ( D i s c o v e r y C l i e n t . j a v a : 414 ) [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t c o m . n e t f l i x . d i s c o v e r y . D i s c o v e r y C l i e n t . < i n i t > ( D i s c o v e r y C l i e n t . j a v a : 269 ) [ e u r e k a − c l i e n t − 1.9.3. j a r : 1.9.3 ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . n e t f l i x . e u r e k a . C l o u d E u r e k a C l i e n t . < i n i t > ( C l o u d E u r e k a C l i e n t . j a v a : 63 ) [ s p r i n g − c l o u d − n e t f l i x − e u r e k a − c l i e n t − 2.0.2. R E L E A S E . j a r : 2.0.2. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . n e t f l i x . e u r e k a . E u r e k a C l i e n t A u t o C o n f i g u r a t i o n 6.execute(EurekaHttpClientDecorator.java:137) ~[eureka-client-1.9.3.jar:1.9.3] at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.9.3.jar:1.9.3] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) ~[eureka-client-1.9.3.jar:1.9.3] at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1051) [eureka-client-1.9.3.jar:1.9.3] at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:965) [eureka-client-1.9.3.jar:1.9.3] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:414) [eureka-client-1.9.3.jar:1.9.3] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:269) [eureka-client-1.9.3.jar:1.9.3] at org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:63) [spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration 6.execute(EurekaHttpClientDecorator.java:137) [eurekaclient1.9.3.jar:1.9.3]atcom.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) [eurekaclient1.9.3.jar:1.9.3]atcom.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eurekaclient1.9.3.jar:1.9.3]atcom.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1051)[eurekaclient1.9.3.jar:1.9.3]atcom.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:965)[eurekaclient1.9.3.jar:1.9.3]atcom.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:414)[eurekaclient1.9.3.jar:1.9.3]atcom.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:269)[eurekaclient1.9.3.jar:1.9.3]atorg.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:63)[springcloudnetflixeurekaclient2.0.2.RELEASE.jar:2.0.2.RELEASE]atorg.springframework.cloud.netflix.eureka.EurekaClientAutoConfigurationRefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:290) [spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration R e f r e s h a b l e E u r e k a C l i e n t C o n f i g u r a t i o n RefreshableEurekaClientConfiguration RefreshableEurekaClientConfiguration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIB e b 02 e 0 d . C G L I B eb02e0d.CGLIB eb02e0d.CGLIBeurekaClient 0 ( < g e n e r a t e d > ) [ s p r i n g − c l o u d − n e t f l i x − e u r e k a − c l i e n t − 2.0.2. R E L E A S E . j a r : 2.0.2. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . n e t f l i x . e u r e k a . E u r e k a C l i e n t A u t o C o n f i g u r a t i o n 0(<generated>) [spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration 0(<generated>)[springcloudnetflixeurekaclient2.0.2.RELEASE.jar:2.0.2.RELEASE]atorg.springframework.cloud.netflix.eureka.EurekaClientAutoConfigurationRefreshableEurekaClientConfiguration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIBeb02e0d F a s t C l a s s B y S p r i n g C G L I B FastClassBySpringCGLIB FastClassBySpringCGLIBdfda4718.invoke() [spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) [spring-core-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer B e a n M e t h o d I n t e r c e p t o r . i n t e r c e p t ( C o n f i g u r a t i o n C l a s s E n h a n c e r . j a v a : 365 ) [ s p r i n g − c o n t e x t − 5.0.10. R E L E A S E . j a r : 5.0.10. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . n e t f l i x . e u r e k a . E u r e k a C l i e n t A u t o C o n f i g u r a t i o n BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365) [spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)[springcontext5.0.10.RELEASE.jar:5.0.10.RELEASE]atorg.springframework.cloud.netflix.eureka.EurekaClientAutoConfigurationRefreshableEurekaClientConfiguration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIBeb02e0d.eurekaClient() [spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_221]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_221]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean 1 ( A b s t r a c t B e a n F a c t o r y . j a v a : 353 ) [ s p r i n g − b e a n s − 5.0.10. R E L E A S E . j a r : 5.0.10. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . c o n t e x t . s c o p e . G e n e r i c S c o p e 1(AbstractBeanFactory.java:353) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.cloud.context.scope.GenericScope 1(AbstractBeanFactory.java:353)[springbeans5.0.10.RELEASE.jar:5.0.10.RELEASE]atorg.springframework.cloud.context.scope.GenericScopeBeanLifecycleWrapper.getBean(GenericScope.java:390) ~[spring-cloud-context-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:184) ~[spring-cloud-context-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:350) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration.getTargetObject(EurekaRegistration.java:167) ~[spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration.getEurekaClient(EurekaRegistration.java:156) ~[spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_221]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_221]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:223) ~[spring-core-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.cloud.context.scope.GenericScope L o c k e d S c o p e d P r o x y F a c t o r y B e a n . i n v o k e ( G e n e r i c S c o p e . j a v a : 494 )   [ s p r i n g − c l o u d − c o n t e x t − 2.0.2. R E L E A S E . j a r : 2.0.2. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . a o p . f r a m e w o r k . R e f l e c t i v e M e t h o d I n v o c a t i o n . p r o c e e d ( R e f l e c t i v e M e t h o d I n v o c a t i o n . j a v a : 185 )   [ s p r i n g − a o p − 5.0.10. R E L E A S E . j a r : 5.0.10. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . a o p . f r a m e w o r k . C g l i b A o p P r o x y LockedScopedProxyFactoryBean.invoke(GenericScope.java:494) ~[spring-cloud-context-2.0.2.RELEASE.jar:2.0.2.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.aop.framework.CglibAopProxy LockedScopedProxyFactoryBean.invoke(GenericScope.java:494) [springcloudcontext2.0.2.RELEASE.jar:2.0.2.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) [springaop5.0.10.RELEASE.jar:5.0.10.RELEASE]atorg.springframework.aop.framework.CglibAopProxyDynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIB97c13022.getEurekaClient() ~[spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry.maybeInitializeClient(EurekaServiceRegistry.java:57) ~[spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry.register(EurekaServiceRegistry.java:39) ~[spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaAutoServiceRegistration.start(EurekaAutoServiceRegistration.java:80) ~[spring-cloud-netflix-eureka-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access 200 ( D e f a u l t L i f e c y c l e P r o c e s s o r . j a v a : 53 )   [ s p r i n g − c o n t e x t − 5.0.10. R E L E A S E . j a r : 5.0.10. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . D e f a u l t L i f e c y c l e P r o c e s s o r 200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor 200(DefaultLifecycleProcessor.java:53) [springcontext5.0.10.RELEASE.jar:5.0.10.RELEASE]atorg.springframework.context.support.DefaultLifecycleProcessorLifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at com.leyou.LeyouUploadApplication.main(LeyouUploadApplication.java:12) ~[classes/:na]

问题解决

修改配置文件application.yml,写出正确的eureka地址端口即可。
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值