Spring RestTemplate调用间歇性失败,并显示“ SocketException:连接重置”

时间:2019-09-09 08:04:03

标签: spring rest spring-boot httpclient spring-rest

当我们的应用程序使用Spring Boot RestTemplate使用Rest端点时,出现以下异常。

org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://xxxxxxxxxx:123456/xxxxx/xxxxx/xxxxxx/xxxx": 
Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset; nested exception is javax.net.ssl.SSLException: 
Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
                at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:741)
                at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:684)
                at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:466)

我们间歇性地遇到这个问题。有时会超过2至3次。

我找不到与此问题有关的任何信息?

有人遇到相同的问题,如何解决?

1 个答案:

答案 0 :(得分:0)

您尝试使用RESTTemplate访问的端点上的CURL是否可以查看您的计算机是否可以访问该URL? 如果是->让我知道并且仍然出现错误,请让我知道我将更新答案:) 如果不是->那我在facebook API上也遇到了同样的问题。

相关问题