kotlin feign.RetryableException:连接重置执行POST

mklgxw1f  于 2022-11-16  发布在  Kotlin
关注(0)|答案(1)|浏览(808)

我从外部服务器调用一个url,在5%的情况下我会遇到这个问题。管道中断,我怀疑问题是出在我的应用程序中,还是出在由于某种原因而取消请求的外部服务中
我正在使用Kotlin+ spring Boot +伪装客户端

feign.RetryableException: Connection reset executing POST https://xpto.com/test // real url omitted
    at feign.FeignException.errorExecuting(FeignException.java:249)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:129)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)
    at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
    at com.sun.proxy.$Proxy228.create(Unknown Source)
    at com.creditas.b2bapi.infrastructure.adapter.BcrediAdapter.createLead(BcrediAdapter.kt:22)
    at com.creditas.b2bapi.service.LeadBcrediService.createBcrediLead(LeadBcrediService.kt:44)
    at com.creditas.b2bapi.service.LeadBcrediService$$FastClassBySpringCGLIB$$a7c46a37.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
    ... 142 common frames omitted
    Suppressed: java.net.SocketException: Broken pipe
        at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:421)
        at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:441)
        at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:825)
        at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1007)
        at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:82)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:355)
        ... 166 common frames omitted
Caused by: java.net.SocketException: Connection reset
    at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:324)
    at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:351)
    at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:802)
    at java.base/java.net.Socket$SocketInputStream.read(Socket.java:937)
    at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:450)
    at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:68)
    at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1409)
    at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1022)
    ... 162 common frames omitted
sczxawaw

sczxawaw1#

我也遇到过这类错误,我的解决方案是改变我正在使用的jdk,异常消失了!所以我真的不知道问题的根源,但改变jdk对我有用。你可以尝试使用intellij提供的JDK。这篇文章会有很大的帮助。https://www.jetbrains.com/help/idea/sdk.html#jdk

相关问题