Topic
7 replies Latest Post - ‏2012-12-12T17:55:28Z by cotner
cotner
cotner
4 Posts
ACCEPTED ANSWER

Pinned topic Client init failed. Connection to the service is not available.

‏2012-12-06T23:52:56Z |
I'm trying to get a simple Dojo app to run on the android emulator with Worklight 5. I get this error immediately after the app launches in the emulator: "Client init failed. Connection to the service is not available.".

I verified that the ip address used by the emulator matches the ip address of my Win 7 system.
I also did a netstat -a, and I can see the worklight listener on port 8080 is listening.

I tried using firefox on my windows system to bring up the worklight console in a windows browser session, so I can check if the worklight server is working without the emulator in the picture (http:localhost:8080/console). When I do that, I get this error:

HTTP ERROR 404

Problem accessing /console. Reason:

ProxyServlet: /console

Powered by Jetty://
I suspect that this same error is what is causing the android emulator to fail. Any ideas on how to overcome this?
Thanks,
Curt
  • SystemAdmin
    SystemAdmin
    2327 Posts
    ACCEPTED ANSWER

    Re: Client init failed. Connection to the service is not available.

    ‏2012-12-09T11:01:18Z  in response to cotner
    i encountered same 404 error when i forget "build and deploy" for application, especially just after launching Worklight Studio.
    • cotner
      cotner
      4 Posts
      ACCEPTED ANSWER

      Re: Client init failed. Connection to the service is not available.

      ‏2012-12-10T01:19:24Z  in response to SystemAdmin
      I did "build all" several times. I don't see a "build and deploy" option anywhere.
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Client init failed. Connection to the service is not available.

    ‏2012-12-09T11:52:19Z  in response to cotner
    cotner,

    Could you please tell me if these were the steps you have taken?

    1. Launched Eclipse
    2. Created new Worklight projet
    3. Added Worklight project
    4. Added Android environment
    5. Updated IP address in application-descriptor.xml
    6. Run As >> Build all and deploy
    7. Install app on device/emulator

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • cotner
      cotner
      4 Posts
      ACCEPTED ANSWER

      Re: Client init failed. Connection to the service is not available.

      ‏2012-12-10T01:37:34Z  in response to IdanAdar
      1-5 yes
      6 I did "run as >> android application". I don't see "build all and deploy" as on option for "run as".
      7 I see my app on the emulator's list of apps, so I believe it installed successfully.
      I should be able to use Firefox to bring up the worklight console, right? Seems like that should work even if the app deployment to the emulator has problems, since Firefox is not using the emulator to connect to the worklight console. Both of these URLs fail with the HTTP 404 error I described:
      http:localhost:8080/console
      http:9.165.109.235:8080/console (which was my local IP address at the time)

      Curt
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Client init failed. Connection to the service is not available.

    ‏2012-12-10T04:04:00Z  in response to cotner
    To perform step 6 you need to right-click on your Worklight application, choose Run As >> Build all and deploy.
    This will also ensure your Worklight Server is up and running. The next step would be to transfer the app to the emulator/device.

    
    Worklight project --- Worklight application ------ environments
    


    If step 6 fails, we have another problem.

    Have you tried our Getting Started training modules?
    What is your Worklight version? We have recently released v5.0.5

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Client init failed. Connection to the service is not available.

    ‏2012-12-10T05:35:45Z  in response to cotner
    Please see the attached screen shot. Is this your step 6?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • cotner
      cotner
      4 Posts
      ACCEPTED ANSWER

      Re: Client init failed. Connection to the service is not available.

      ‏2012-12-12T17:55:28Z  in response to IdanAdar
      Yes, that solved the problem for me. Thanks. I watched various tutorials, but somehow this step escaped me.