java.net.ConnectException:连接超时,CRM on Demand查询操作

时间:2015-12-10 04:54:44

标签: java crm dynamics-crm-online

嗨,大家好,请帮我解决这个问题,

当我执行Oracle托管型CRM操作(查询集成队列)时有时我会遇到此异常......

java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:625)
    at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1092)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
    at com.crmit.ws2.crmoperations.CRMServices.queryEvent(CRMServices.java:2449)
    at com.interfaceglobal.ieqframework.bo.BoIEQSync.queryIQReocrds(BoIEQSync.java:54)
    at com.interfaceglobal.ieqframework.bo.BoIEQSync.queryIQAndSaveInDatabase(BoIEQSync.java:100)
    at com.interfaceglobal.ieqframework.service.StartReadingIQFromCRMOD.main(StartReadingIQFromCRMOD.java:41)

1 个答案:

答案 0 :(得分:0)

您可以在获取Outputstream之前调整连接超时。

urlConnection.setConnectTimeout(<Number of Milliseconds>);