Worklight:服务连接失败对话框

时间:2013-04-14 17:28:13

标签: service connection ibm-mobilefirst

我正面临一个意想不到的问题,就是我在运行App时 大多数情况下,对话框打开并说“应用程序失败了 与服务的连接“查看快照:

enter image description here

虽然在此对话框中按“重新加载”两三次后,将应用程序与WL服务器连接,然后应用程序正常工作。但是如果我杀了App然后重新运行它,那么同样会出现相同的对话框。

在设备上安装后第一次运行App时也会出现。

我的应用程序在两个月前运行良好。

我所做的唯一新事物是推送通知。这是
我在App中添加的新功能。

对此有何建议?

  1. 这个问题的根本原因是什么?我该如何追踪它?
  2. 如果我想禁用此对话框,而是显示
    屏幕上的自定义消息(警报)。因为此对话框显示了 正在运行服务/ WL服务器URL。
  3. 在控制台中,它仅显示“应用程序与服务的连接失败

    单击对话框中的“详细信息”选项。它显示WL服务器的正确地址。经过三次/四次重新加载后,它将App连接到服务器,然后工作正常,之后就可以了,并且没有显示任何内容。

    日志如下:

    Apr 15 14:24:51 iPhone myApp[2746] <Warning>: [LOG] ondeviceready event dispatched
    Apr 15 14:24:51 iPhone myApp [2746] <Warning>: {
            appVersionPref = "1.0";
            freeSpace = 13572620288;
            wlSkinLoaderChecksum = "(null)";
            wlSkinName = default;
        }
    Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] Application did not define an i18n messages object, skipping translation.
    Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] wlclient init started
    Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] Read cookies: null
    Apr 15 14:24:51 iPhone myApp [2746] <Warning>: [LOG] CookieMgr read cookies: {}
    Apr 15 14:24:57 iPhone myApp [2746] <Warning>: [LOG] Connection went Down: Mon Apr 15 2013 14:24:57 GMT+0300 (AST)
    Apr 15 14:24:57 iPhone myApp [2746] <Warning>: [ERROR] Client init failed. Connection to the service is not available.
    Apr 15 14:25:07 iPhone myApp [2746] <Warning>: [LOG] ondeviceready event dispatched
    Apr 15 14:25:07 iPhone myApp [2746] <Warning>: {
            appVersionPref = "1.0";
            freeSpace = 13572620288;
            wlSkinLoaderChecksum = "(null)";
            wlSkinName = default;
    }
    
    单击详细信息

    Apr 15 2013 23:55:17 GMT+0300 (AST)
    Apr 15 23:55:17 iPhone myApp[3116] <Warning>: [ERROR] Client init failed. Connection to the service is not available.
    Apr 15 23:55:19 iPhone myApp[3116] <Warning>: WLReachability Flag Status: -R -----l- networkStatusForFlags
    Apr 15 23:55:59 iPhone kernel[0] <Debug>: launchd[3120] Builtin profile: MobileSafari (sandbox)
    Apr 15 23:56:02 iPhone kernel[0] <Debug>: launchd[3121] Builtin profile: syncdefaultsd (sandbox)
    Apr 15 23:56:21 iPhone myApp[3116] <Warning>: Copied text: 'App Diagnostics
    
        Time : Mon Apr 15 2013 23:55:19 GMT+0300 (AST)
        Application Name : myApp
        Application Version : 1.0
        Service URL : https://www.mydomain.com.bh:443/AppProject/apps/services/api/myApp/iphone/
        Device Platform : iPhone
        Device Version : 6.1
        Screen Resolution : 320x480
        Airplane Mode : Not available
        Using Network : WIFI
        Wifi Name : Not available
        Mobile Network Type : Not available
        Carrier Name : Not available
        IP Address : 192.168.109.101
        Error Code : UNRESPONSIVE_HOST
        Error Message : Connection to the service is not available.
        HTTP Status : 
    

1 个答案:

答案 0 :(得分:0)

听起来有一个网络问题阻止您连接到Worklight服务器。

这可能是由于许多不同的原因,列举一些:

  • 差WiFi / 3G
  • 设备故障
  • 托管网络服务器的网络上的防火墙问题
  • Worklight服务器问题

为了确保您确实到达服务器,我建议使用网络嗅探器。在Windows上运行的一个工具是Fiddler

可以将Fiddler设置为反向代理,您的设备将在其中调用代理。然后,代理会将您的请求路由到Web服务器,但它也会记录信息,以便您查看它。

如果您使用的是Windows,我建议您安装Fiddler并遵循this answer的选项#2。

然后,您应该能够查看您的请求是否到达服务器并从那里继续调查。

相关问题