Search code examples
ibm-mobilefirstmobilefirst-adaptersmobilefirst-server

Error running application in mobile first android simulator


Running into strange issue, where by my app is running in the "preview" servlet, but when I am trying to run in Android emulator getting weird errors and finally timing out,

10-12 10:13:59.860: W/PluginManager(885): THREAD WARNING: exec() call to WLAuthorizationManagerPlugin.getClientInstanceIdHeader blocked the main thread for 7546ms. Plugin should use CordovaInterface.getThreadPool().
    10-12 10:14:00.080: D/wl.request(885): WLRequestSender.run in WLRequestSender.java:40 :: Sending request http://10.0.0.9:10080/DoradoBankProject/authorization/v1/clients/instance
    10-12 10:14:00.330: I/Choreographer(885): Skipped 53 frames!  The application may be doing too much work on its main thread.
    10-12 10:14:00.650: I/Choreographer(885): Skipped 34 frames!  The application may be doing too much work on its main thread.
    10-12 10:14:00.970: I/Choreographer(885): Skipped 34 frames!  The application may be doing too much work on its main thread.
    10-12 10:14:01.290: I/Choreographer(885): Skipped 33 frames!  The application may be doing too much work on its main thread.
    10-12 10:14:04.000: E/NONE(885): Request timeout for [/apps/services/api/DoradoBankProject/android/query]

Just to note here I am not using any authentication in this module. This is how my adaptor.xml looks like

<procedure name="getAccounts"  securityTest="wl_unprotected"/>
<procedure name="getTransactions" securityTest="wl_unprotected"/>

I am not sure what's causing this or any way to debug.


Solution

  • Typically happens when an incorrect hostname was specified for the application. When you preview the application in the console via your desktop browser, it has the IP that the development server assigned, however when running in a device you must ensure that the correct IP or hostname is used. If "localhost" is used, this will be a problem.

    I see from the log that 10.0.0.9 is used, can you confirm this is the IP of the server? I suggest to find your public IP address and use that, as the host value in wlclient.properties.