简体   繁体   中英

Error - "com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server"

I am receiving this error - "com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server" while running the client application in spring-boot while trying for a authentication module using Spring Boot in Microservice.

Below is my server and client application.properties file:

Server - application.properties

spring.application.name=demoEureka
#This is a eureka server so no need to register
eureka.client.register-with-eureka=false
#This is a eureka server no need to fetch registry
eureka.client.fetch-registry=false
#eureka.client.enabled=false
#Register url for client
server.port=8085
eureka.instance.hostname=localhost
eureka.client.service-url.defaultZone: http://localhost:8085/eureka/
#timeout
eureka.server.wait-time-in-ms-when-sync-empty=0

spring.security.basic.enabled=true
spring.security.user.name=atul
spring.security.user.password=atul

#All url come with prefix/api will interpret
zuul.prefix=/api
#zuul.routes.middleware.path=/cart/**
zuul.routes.cart.path=/cart/**
#zuul.routes.middleware.url=http://localhost:8081/
zuul.routes.cart.url=http://localhost:8081/

#server.port=8098

Client - application.properties

spring.application.name=cart
server.port=8081
#Eureka server url for registering
#This is eureka client
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
#register url to server
eureka.client.serviceUrl.defaultZone=http://localhost:8085/eureka/
eureka.instance.hostname=localhost
#eureka.client.serviceUrl.defaultZone=http://atul:atul@localhost:8085/eureka

Please help me in removing the error and successful execution of program.

check flowing:

  1. service is start
  2. network is ok
  3. system proxy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM