問題描述
WSO2 ‑ 無法將ViaPost 發送到 url (WSO2 ‑ Unable to sendViaPost to url)
我正在使用 WSO2 ESB 通過呼叫中介將 JSON 消息發送到 Bitrix CRM。我查看了所有帖子和教程,但總是遇到相同的錯誤:HTTPSender ‑ Unable to sendViaPost to url 在我將 Bitrix24 切換為使用 Nginx Push 後,我在 ESB 上遇到了以下問題。
TID[‑1234] [EI] [2020‑02‑11 07:04:01,702] INFO {org.apache.axis2.transport.http.HTTPSender} ‑ Unable to sendViaPost to url[https://xxxx.com/rest/update?id=33826]
org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.verifyHostname(TLSProtocolSocketFactory.java:233)
org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.createSocket(TLSProtocolSocketFactory.java:194)
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:704)
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:81)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:459)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:441)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:227) org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:490)
org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:382)
org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:88)
org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:547)
org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:384)
org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:164)
org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:119)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:37)
org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:203)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
org.apache.synapse.mediators.builtin.ForEachMediator.mediateSequence(ForEachMediator.java:183)
org.apache.synapse.mediators.builtin.ForEachMediator.mediate(ForEachMediator.java:145)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:224)
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:415)
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
我的呼叫調解員看起來像:
<property description="messageType JSON"
name="messageType"
scope="axis2"
type="STRING"
value="application/json"/>
<call blocking="true">
<endpoint>
<http method="POST"
statistics="enable"
trace="enable"
uri‑template="{uri.var.RESTURL}">
<suspendOnFailure>
<errorCodes>400</errorCodes>
<initialDuration>0</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
</http>
</endpoint>
</call>
我嘗試使用 Postman 發送相同的消息,它工作正常。感謝您的幫助。
更新
管理面板中的日誌未滿。我在服務器上手動檢查過,問題出在:javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
UPDATE2
全棧:
[2020‑02‑11 22:18:01,953] [EI‑Core] INFO ‑ HTTPSender Unable to sendViaPost to url[https:/xxxx.com/rest/7]
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:450)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:276)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:186)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:704)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:81)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:459)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:441)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:227)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:490)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:382)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:88)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:547)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:384)
at org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:164)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:119)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:37)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:203)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:37)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:203)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.mediators.builtin.ForEachMediator.mediateSequence(ForEachMediator.java:183)
at org.apache.synapse.mediators.builtin.ForEachMediator.mediate(ForEachMediator.java:145)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:224)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:415)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
參考解法
方法 1:
There seems to be a known issue in Call mediator blocking="true" mode. Please try out the work around suggested in the issue.
As a workaround for this, we can disable switching to opensaml http client by setting rampart.axiom.parser.pool=false in a server start up.
(by sz3jdii、Arunan Sugunakumar)