1
String url = "http://********";

rt = restTemplate.getForObject(url, pojoObj.getClass());

It works fine in 1.8, but when I change the compiler to Java 11 it throws an error:

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http//******": localhost; nested exception is java.net.UnknownHostException: localhost
leonheess
  • 16,068
  • 14
  • 77
  • 112
Surya Prakash
  • 105
  • 1
  • 1
  • 4

0 Answers0