2017-04-03 64 views
0

我試圖將數據插入到數據庫表&我收到以下錯誤:騾:DB插入失敗,超時

異常堆棧: 1.超時超標(java.util.concurrent.TimeoutException) com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider:426(null) 2.發送HTTP請求時出錯。消息有效載荷的類型爲:字符串(org.mule.api.MessagingException) org.mule.module.http.internal.request.DefaultHttpRequester:287(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html


根異常堆棧跟蹤: 的java。 util.concurrent.TimeoutException:超時時間超過 at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:426) at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider $ 3.onTimeout (GrizzlyAsyncHttpProvider.java:274) at org.glassfish.grizzly.utils.IdleTimeoutFilter $ DefaultWorker.doWork(IdleTimeoutFilter.java:398) at org.glassfish.griz zly.utils.IdleTimeoutFilter $ DefaultWorker.doWork(IdleTimeoutFilter.java:377) at org.glassfish.grizzly.utils.DelayedExecutor $ DelayedRunnable.run(DelayedExecutor.java:158) at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1142) 在java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:617) 在java.lang.Thread.run(Thread.java:745)


我插入代碼如下:

 <flow name="api-main"> 
    <http:listener config-ref="db-system-api-httpListenerConfig" path="/api/*" doc:name="HTTP"/> 
    <apikit:router config-ref="db-system-api-config" doc:name="APIkit Router"/> 
    <exception-strategy ref="db-system-api-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/> 
    </flow> 

    <flow name="put:/contract/{id}:db-system-api-config" processingStrategy="synchronous" > 
    <set-property propertyName="Content-Type" value="application/json" doc:name="Set Content Type"/> 
    <logger message="#[payload]" level="INFO" doc:name="Initial Payload"/> 

    <json:json-to-object-transformer returnClass="java.util.HashMap" mimeType="text/plain" doc:name="JSON to Object"/> 


     <foreach collection="#[payload.entrySet()]" doc:name="For Each"> 
     <db:insert config-ref="Oracle_Configuration" doc:name="Database"> 
     <db:parameterized-query><![CDATA[INSERT INTO XX.XX_OE_HDR (ID, 
                       NUMBER, 
                       EFF_START_DATE, 
                       EFF_END_DATE, 
                       CUST_NUMBER) 
                       VALUES (xx.XX_HDR_SEQ.NEXTVAL, 
                         xx.XX_HDR_NUM_SEQ.NEXTVAL, 
                         TO_DATE('2017-05-23','YYYY-MM-DD HH24:MI:SS'), 
                         TO_DATE('2017-06-23','YYYY-MM-DD HH24:MI:SS'), 
                         #[payload.myField])]]></db:parameterized-query> 
     </db:insert> 
     </foreach> 
     <logger message="Record successful" level="INFO" doc:name="Log Success"/> 
+0

任何人都可以輸入嗎? – insaneyogi

回答

0

根據Timeout exceeded at com.ning.http.client您的問題位於http請求中。據我所知,Oracle數據庫(作爲大多數常用數據庫)使用TCP協議進行傳輸,而您的問題位於http超時。

您能提供完整的流程以及您如何觸發流程?

另一方面,您是否可以嘗試隔離問題並將數據庫替換爲記錄器,並檢查流向HTTP請求是否存在問題? (假設你通過http請求觸發這個流程)

+0

感謝您回覆馬里奧,請結帳更新代碼。我會嘗試替換數據庫記錄器 – insaneyogi