当我的API尝试连接到数据库时,我一直收到以下错误:
消息:发送HTTP请求时出错。消息有效内容的类型为:String 键入:org.mule.api.MessagingException 代码:MULE_ERROR - 2 JavaDoc:http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
异常堆栈是: 1.超时超时(java.util.concurrent.TimeoutException) com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider:426(null) 2.发送HTTP请求时出错。消息有效内容的类型为:String(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)
Root异常堆栈跟踪: java.util.concurrent.TimeoutException:超出超时 在com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:426) 在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.grizzly.utils.IdleTimeoutFilter $ DefaultWorker.doWork(IdleTimeoutFilter.java:377) 在org.glassfish.grizzly.utils.DelayedExecutor $ DelayedRunnable.run(DelayedExecutor.java:158) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617) 在java.lang.Thread.run(Thread.java:745)
我的API正在尝试连接到数据库,如下所示:
<flow name="system-api-config" >
<set-property propertyName="Content-Type" value="application/json" doc:name="Set Content Type"/>
<json:json-to-object-transformer returnClass="java.lang.Object" doc:name="JSON to Object"/>
<!-- <set-variable variableName="agreementLinePayload" value="#[new java.util.ArrayList()]" doc:name="Set Entries"/> -->
<set-variable variableName="agPayload" value="#[new java.util.HashMap()]" doc:name="Set Entries"/>
<set-variable variableName="agLnID" value="#[payload.agLnID]" "/>
<set-variable variableName="exe" value="#[payload.exe]" "/>
<logger message="Extended Price :#[flowVars.extendedPrice]" level="INFO" doc:name="Logger"/>
<expression-component doc:name="Expression"><![CDATA[
flowVars.agreementLinePayload.add(payload.agLnID);
flowVars.agreementLinePayload.add(payload.exe);
]]>
</expression-component>
<db:bulk-execute config-ref="Oracle_Configuration" doc:name="Database"><![CDATA[INSERT INTO HDR(ID,
someNUMBER,
START_DATE,
END_DATE,
O_NUMBER)
VALUES (SEQ.NEXTVAL,
NUM_SEQ.NEXTVAL,
TO_DATE('2017-02-17','YYYY-MM-DD HH24:MI:SS'),
TO_DATE('2018-02-17','YYYY-MM-DD HH24:MI:SS'),
#[payload.myField])
</db:bulk-execute>
...
我尝试过切换连接超时&amp; HTTP请求超时但无济于事。当我进行数据库调用时,它总是给出这个超时异常,请给出想法。
答案 0 :(得分:0)
您是否尝试过在数据库中执行sql查询?可能是查询需要很长时间才能处理。