【问题标题】:Spring RestTemplate call fails intermittently with 'SocketException: Connection reset'Spring RestTemplate 调用间歇性失败并出现“SocketException:连接重置”
【发布时间】:2023-03-14 09:11:01
【问题描述】:

当我们的应用程序使用 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 次。

我找不到任何特定于此问题的信息?

是否有人面临同样的问题以及如何解决?

【问题讨论】:

  • 您解决了这个问题吗?我们看到了同样的问题。我们添加了一些糟糕的注释,但并没有解决根本问题。

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-14
    • 2022-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多