Reputation: 2271
I am getting this exception org.springframework.web.client.ResourceAccessException I/O error on POST request for \"http://host.docker.internal:8073/user-management/users/login\": Connection timed out: connect; nested exception is java.net.ConnectException: Connection timed out: connect", My code looks like this
@Resource(name="restTemp")
private RestTemplate restTemplate;
String url = "user-management/users/login";
//String fullUrl = "https://localhost:8073/user-management/users/login";
InstanceInfo instance = eurekaClient.getNextServerFromEureka("user-management", false);
LoginRequest user = restTemplate.postForObject(instance.getHomePageUrl()+url, loginRequest, LoginRequest.class);
Also I dont understand why instance.getHomePageUrl() generates a internal docker url . what could be the reason behind this docker desktop is running. I need help in resolving this exception.According to what I could find this exception occurs when we are trying to access a third party url
Upvotes: 1
Views: 4275
Reputation: 533
Just try increasing the context timeout for request sent by RestTemplate
Upvotes: 1