私は以下の2つのAPIを持っています。私はAPI2を私のAPI1仲介者を送って使用したが応答が返されず、エラーがログに出力されます。APIマネージャ - メディエータを送信する:「キャッチされない例外{org.apache.axis2.transport.base.threads.NativeWorkerPool} java.lang.NumberFormatException:null」
API1 -
URL https://localhost:8243/sendtest/1.0/{num}
フローシーケンスで
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="send_mediator_test_in" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="get-property('uri.var.num')" name="uri.var.num" scope="default" type="STRING"/>
<send>
<endpoint>
<http method="get" uri-template="https://localhost:8243/protest/1.0/{uri.var.num}"/>
</endpoint>
</send>
</sequence>
API2 - (プロトタイプ宣言)
URL以下の環境でAPI1を呼び出しhttps://localhost:8243/protest/1.0/{num}
インラインスクリプト
mc.setProperty('CONTENT_TYPE', 'application/json');
var Num = mc.getProperty('uri.var.num');
mc.setPayloadJSON({ "NumberReturn": Num });
応答
{
"NumberReturn": "100"
}
は正常に動作し、適切な応答が返されます。
OS: Windows 7
Java: 1.7.0_45
WSO2 AM: 2.0.0
しかしAPI1
TID: [-1] [] [2017-02-03 06:34:23,265] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-02-03 06:34:23,265] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "a4[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-02-03 06:34:23,265] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "0[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-02-03 06:34:23,265] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1234] [] [2017-02-03 06:34:23,278] ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool}
java.lang.NumberFormatException: null
at java.lang.Long.parseLong(Long.java:404)
at java.lang.Long.parseLong(Long.java:483)
at org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler.handleResponse(APIMgtLatencyStatsHandler.java:43)
at org.apache.synapse.rest.API.process(API.java:323)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:90)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:56)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:300)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:255)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
TID: [-1234] [] [2017-02-03 06:34:30,750] INFO {org.wso2.andes.server.handler.ChannelCloseHandler} - Received channel close for id 1 citing class 0 and method 0 {org.wso2.andes.server.handler.ChannelCloseHandler}
TID: [-1234] [] [2017-02-03 06:34:30,750] INFO {org.wso2.andes.server.AMQChannel} - No consumers to unsubscribe on channel [/127.0.0.1:53226(admin):1] {org.wso2.andes.server.AMQChannel}
TID: [-1234] [] [2017-02-03 06:34:30,750] INFO {org.wso2.andes.kernel.FlowControlManager} - Channel removed (ID: 127.0.0.1:53226) {org.wso2.andes.kernel.FlowControlManager}
TID: [-1234] [] [2017-02-03 06:34:30,752] INFO {org.wso2.andes.server.handler.ConnectionCloseMethodHandler} - ConnectionClose received with reply code/reply text 200/JMS client is closing the connection. for /127.0.0.1:53226(admin) {org.wso2.andes.server.handler.ConnectionCloseMethodHandler}
の呼び出し中に間違っているものを教えてください環境下の
OS: Red Hat Enterprise Linux Server release 6.8 (Santiago)
Java: 1.7.0_101
WSO2 AM: 2.0.0
エラーでエラーが発生します。
あなたは 'inq/2.0'の設定も投稿できますか? – Bee
@Bhathiya - inq/2.0がAPIの例でした。上記のAPIと環境の両方について詳細を追加しました。 –