在服务器中获取连接重置错误,在本地正常工作

2vuwiymt  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(168)

实际上我们正在尝试设置支付网关。编码部分已经完成,并且可以在localhost上正常工作,但是当部署到测试服务器时,它停止了工作。它在给予 java.net.SocketException: Connection reset 例外。stacktrace的快照是

[http-nio-80-exec-78] INFO  o.a.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://api.razorpay.com:443: Connection reset
09:23:27.461 [http-nio-80-exec-78] INFO  o.a.http.impl.execchain.RetryExec - Retrying request to {s}->https://api.razorpay.com:443
09:23:27.949 [http-nio-80-exec-78] INFO  o.a.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://api.razorpay.com:443: Connection reset
09:23:27.950 [http-nio-80-exec-78] INFO  o.a.http.impl.execchain.RetryExec - Retrying request to {s}->https://api.razorpay.com:443
09:23:28.436 [http-nio-80-exec-78] INFO  o.a.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://api.razorpay.com:443: Connection reset
09:23:28.436 [http-nio-80-exec-78] INFO  o.a.http.impl.execchain.RetryExec - Retrying request to {s}->https://api.razorpay.com:443
2020-01-24 09:23:28,925 ERROR [http-nio-80-exec-78] controllers.PaymentControllerImpl (PaymentControllerImpl.java:97) - getPaymentLinkToBuyCredit - Exception for user  :xyz,java.net.SocketException: Connection reset

现在,当我们在测试服务器中使用curl(使用下面的命令)测试相同的代码时,它工作得很好。

curl -u <username>:<password> \-X POST https://api.razorpay.com/v1/invoices/ \-H 'Content-type: application/json' \-d '{"type": "link",  "view_less": 1,  "amount": 100,  "currency": "INR",  "description": "Payment Link for this purpose.",  "reminder_enable": true,  "sms_notify": 1,  "email_notify": 1,  "expire_by": 1793630556}'

有人知道吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题