When I hit the URL on either on Chrome or Postman, requestURL works fine get Status : 200 OK but it I Run or debug from Eclipse, it throws below expception

Database is OpenTSDB

Spring MVC tomcat server9.0.62

MultiValueMap<String, String> headers = new LinkedMultiValueMap<String, String>();
   headers.add("Authorization", token);
   headers.add("Accept", "application/json");
   headers.add("Content-Type", "application/json");    
   request = new HttpEntity<String>("", headers);

restTemplate.exchange(requestURL, HttpMethod.GET, request, String.class, filters)

this is exception thrown

ResourceAccessException : I/O error on GET request for "http://****.com:4140/sys/query/q?start=2023/06/21-00:24:00&end=2023/06/26-00:24:01&m=sum:30s-avg-none:rate:data.set.packs%7BbillId%3D*,y_work_id%123987Dfve7,direction%3Dforward%7D":connect":Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
get root cause ResourceAccessException : java.net.ConnectException: Connection refused: connect
0

There are 0 best solutions below