Topic
  • 11 replies
  • Latest Post - ‏2013-02-10T06:51:02Z by IdanAdar
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic Application failed connecting to the service in Android device

‏2012-08-03T07:16:11Z |
Im working in worklight for past one month. there is no such problem i find in my application. It works gud in console. i.e in worklight console browser. When i try to run it on device (HTC Explorer 2.3) it shows this error. Internet pass through is there. I have checked that too. Then why its not displaying WL service. And there is no complex application its just executing the html5 page. Today only i got this specific error. sry for my bad english
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-03T07:19:35Z  
    And another thing is my old application which related to worklight also is not currently running now. Whether there is any maintaineance work is going on WL server
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-03T11:13:06Z  
    In your application's application-descriptor.xml, make sure that you are not pointing to locahost as the worklightServerHomeURL value.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-06T10:25:54Z  
    • IdanAdar
    • ‏2012-08-03T11:13:06Z
    In your application's application-descriptor.xml, make sure that you are not pointing to locahost as the worklightServerHomeURL value.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    @IdanAdar instead of using <worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL> what should i use.
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-06T10:31:19Z  
    Sorry, I was referring to worklightServerRootURL.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-06T10:34:58Z  
    • IdanAdar
    • ‏2012-08-03T11:13:06Z
    In your application's application-descriptor.xml, make sure that you are not pointing to locahost as the worklightServerHomeURL value.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    @Idan

    I changed <worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL> to
    <worklightServerRootURL></worklightServerRootURL> Still i got the same Error
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-06T10:43:47Z  
    What you did was to simply remove the IP address.
    What you want to do is to use an ACTUAL IP address, instead of localhost.

    For example:
    <worklightServerRootURL>http://122.39.4.599:8080</worklightServerRootURL>

    Instead of 122.39.4.599, put the IP address designated for your computer.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-06T10:47:28Z  
    • IdanAdar
    • ‏2012-08-06T10:31:19Z
    Sorry, I was referring to worklightServerRootURL.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    @Babu

    You have to replace the ${local.IPAddress} with the IP address of the machine hosting the server.
    i.e. Change <worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL> to
    <worklightServerRootURL>http://###.###.##.##:8080</worklightServerRootURL> giving the IP address.
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2012-08-06T10:59:59Z  
    • IdanAdar
    • ‏2012-08-06T10:43:47Z
    What you did was to simply remove the IP address.
    What you want to do is to use an ACTUAL IP address, instead of localhost.

    For example:
    <worklightServerRootURL>http://122.39.4.599:8080</worklightServerRootURL>

    Instead of 122.39.4.599, put the IP address designated for your computer.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Thanks Idan Before that i never touch Application Descriptor but all my sample application works fine. This is first time im getting this issue. My problem solved it works in device.
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2013-02-08T17:31:12Z  
    @Babu

    You have to replace the ${local.IPAddress} with the IP address of the machine hosting the server.
    i.e. Change <worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL> to
    <worklightServerRootURL>http://###.###.##.##:8080</worklightServerRootURL> giving the IP address.
    i have same problem..

    i tried replacing "http://${local.IPAddress}:8080" in android discriminator with
    i)http://localhost:8080
    ii)http://127.0.0.1
    iii)http://127.0.0.1:8080
    iv)http://10.0.2.2
    v)http://10.0.2.2:8080
    and my pc ip:8080 also
    problem is
    till worklight server is on app is working (with any of the above ip)but when i stopped the server, app showing notification that error in connecting service

    but my app is basic html no need of net connection
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Application failed connecting to the service in Android device

    ‏2013-02-08T17:34:15Z  
    • IdanAdar
    • ‏2012-08-06T10:43:47Z
    What you did was to simply remove the IP address.
    What you want to do is to use an ACTUAL IP address, instead of localhost.

    For example:
    <worklightServerRootURL>http://122.39.4.599:8080</worklightServerRootURL>

    Instead of 122.39.4.599, put the IP address designated for your computer.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    i have same problem..

    i tried replacing "http://${local.IPAddress}:8080" in android discriminator with
    i)http://localhost:8080
    ii)http://127.0.0.1
    iii)http://127.0.0.1:8080
    iv)http://10.0.2.2
    v)http://10.0.2.2:8080
    and my pc ip:8080 also
    problem is
    till worklight server is on app is working (with any of the above ip)but when i stopped the server, app showing notification that error in connecting service

    but my app is basic html no need of net connection
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Application failed connecting to the service in Android device

    ‏2013-02-10T06:51:02Z  
    The IP addresses you have mentioned are all internal. You need to place there you external IPv4 address.
    Open CMD and write "config". Locate your IPv4 address, and place it as the value for worklightServerRootURL in application-descriptor.xml
    Note: IBM forums are in the process of migrating to a new format. During migration the forums will be frozen and in read-only mode. If you wish to continue this thread discussion please post it on stackoverflow, where the Worklight team and others can respond.

    See the Forum Migration announce post for more details. Thank you.
    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14937476

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform