Hi All
Getting a strange error, where Spring Feign client is not able to resolve the service name to url. I have used the sample projects from the below link, but they have not worked on my local environment. However, it works on a colleague's system. Is there any environment specific settings I should be looking at. Essentially, the Feign client is not able to resolve the service name "HelloServer" to localhost:7111 - and hence constructs the service url as http://HelloServer/ ... I've tried both in IntelliJ and Eclipse, but both have same error. Since I'm using the exact copy of the code from the below Git, not sharing any config here.
Any help would be much appreciated.
Url: https://github.com/spring-cloud-samples/feign-eureka
Error: 2020-05-21 11:22:32.806 ERROR 16184 --- [nio-7211-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.RetryableException: connect timed out executing GET http://HelloServer/] with root cause
java.net.SocketTimeoutException: connect timed out at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) ~[na:1.8.0_211] at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) ~[na:1.8.0_211] at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[na:1.8.0_211] at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[na:1.8.0_211] at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_211] at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_211] at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_211] at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_211]
Comment From: patpro123
Found the fix myself. One of the Spring jars were corrupt - since I was using an old version of Spring Cloud and had recently migrated to new.
Resolution - Remove all Spring jars from local repo and force download all jars again.
Thanks.