1.启动项目出现com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect错误
错误原因:在默认设置下,Eureka服务注册中心也会将自己作为客户端来尝试注册它自己,所以我们需要禁用它的客户端注册行为。(我的错误是我的配置文件不正确)在配置文件中加入,注意还需加入端口号,即使是默认的端口8761也需要写上
server.port=8181
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
2.启动服务提供方服务时,日志中总是显示:
Fetching config from server at : http://localhost:8888
Connect Timeout Exception on Url - http://localhost:8888
这些也不是报错,在注册中心已经能看到该服务了。看着不爽,原因好像是优先默认到localhost:8888这个注册中心去注册,然后连接超时再到本地配置文件application.yml中去找server.port配置。解决:localhost:8888好像是cloud自己的默认配置,在pom.xml中去掉下面的依赖就可以了。不走默认配置,优先走本地的server.port。
org.springframework.cloud
spring-cloud-starter-config
2.1.3.RELEASE
3.Unsatisfied dependency expressed through field
feign 接口参数注解Reque