面对java.net.SocketTimeoutException,使用Mobilefirst 6.3进行混合应用程序



我正在使用MF 6.3开发一个混合应用程序。我在通过以下方式请求数据时遇到 java 套接字超时问题适配器。这是不一致的。它发生 3-4/10 次。我也有看到了 GitHub 中提到的相同问题https://github.com/google/google-http-java-client/issues/146 但没有分辨率。

我正在使用 60 秒的适配器超时,并且此异常发生在 10 秒内。

为日志附加日志。

09-18

15:07:29.561:I/System.out(10667(:池-6 线程-2 调用 detatch((

09-18

15:07:39.146:I/System.out(10667(:池-6 线程-5 调用 detatch((

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: WLNativeXHRPlugin$NativeXHRPostListener.onException in WLNativeXHRPlugin.java:154 :: onException

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: java.net.SocketTimeoutException: Read timed timeout

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at com.android.org.conscrypt.NativeCrypto.SSL_read(原生方法(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:728(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:191(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:82(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:180(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.client.DefaultRequestDirector.executeOriginal(DefaultRequestDirector.java:1351(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:700(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:691(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:514(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at com.worklight.wlclient.WLHybridRequestSender.run(WLHybridRequestSender.java:63(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587(

09-18 15:07:39.166: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(10667(: at java.lang.Thread.run(Thread.java:818(

09-18 15:07:39.176: E/NONE(10667(: [/apps/services/api/SCBBizNet/android/query]主机没有响应。 尝试通过安卓模拟器浏览器手动访问网址 验证连接性。

已解决!我们正在调用WL.Logger.send()以在$.getJson内发送日志,该加载配置json文件,我们根据该文件将日志发送到服务器。完成此步骤后,我们从$.getJson回调中出来,并调用适配器以加载包含数据的页面。整个事件发生在按钮单击上。如果我们删除$.getJson并调用WL.Logger.send()它不会给出任何套接字超时异常。

但是,此问题似乎非常不寻常,因为在$.getJson内部调用WL.Logger.send()后,后续适配器调用失败了 5-6 次中的 10 次,导致套接字超时异常超出了适配器层。这种异常在安卓中更常见,而在 iOS 中更少。我们正在进一步调查由$.getJson引起的问题。将发布更新。

相关内容

  • 没有找到相关文章

最新更新