1
votes

I want to develop on my Windows machine and push my changes to an iPad (iOS 7.1.2) test device via direct update. This worked for me in WL 6.1, but since my update to WL 6.2 I'm having some issues. Following scenario describes my problem.

  1. Create new WL project and add iPad as environment
  2. Enabled worklightSettings in application-descriptor.xml
  3. Add the code snippet below to main.js
  4. Run on Worklight Development Server
  5. Open project in Xcode via eclipse
  6. Clean project in Xcode and run on iPad
  7. Make a change, re-deploy and verify Direct Update is received
  8. Copy the project to a Windows machine and open in eclipse
  9. Run on Worklight Development Server on Windows machine
  10. Open the app settings via Settings.app and enable use Custom Server URL
  11. Replace the IP of your mac by the IP of your windows machine
  12. On windows: Make a change and re-deploy
  13. Restart the app on the iPad

The moment I restart my app I get the following exception in my In the worklight development server console on my Windows machine:

[WARNING ] SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init
[ERROR   ] FWLSE0048E: Unhandled exception caught: SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init

When I modify the custom server URL and I remove the last slash, I get the message that an update is available. But when I click update the progress bar in the downloading popup doesn't move. My Windows machine and MAC both have the following WL Studio version: platformVersion="6.2.0.00.20140724-2139". What am I doing wrong?

main.js

function wlCommonInit(){
    WL.Client.connect({
        onSuccess: onConnectSuccess,
        onFailure: onConnectFailure
    });
}

function onConnectSuccess() {
    WL.Logger.debug("Connect success.");
}

function onConnectFailure() {
    WL.Logger.debug("Connect failed.");
}
1
Why not just do it the other way around...? Create your project in the Windows machine. It will get the Windows machine's IP address. Copy the native folder to Mac, run it in Xcode... run it, etc etc. Make an update in Windows machine.Idan Adar
I don't get it, why is there an option to change the server URL if you can only point it to the machine where the project was created? We have multiple developers and we share one iPad, is this setup then not possible? What if I want to connect my iPad to the integration server? Why does it matter on which machine you created your project?Hans
This whole feature is not meant to make your development environment easier. It was originally made for Shell development. The fact you're trying to use it for something else completely is nice, but not its intention.Idan Adar
Additionally, you can point it to whichever Worklight Server you want, as long as the project and its artifacts that you will point to, exist.Idan Adar
BTW, can you try again w/out the error with the slash?Idan Adar

1 Answers

2
votes

This is indeed a defect in Worklight 6.2.

On the one hand, as you mention in your reproduction steps you need to remove the forweawrd slash from the custom server URL in order to be able to connect to the Worklight Server (because otherwise there are 2 slashes in the URL and it fails connecting).

On the other hand, the client requires this forward slash.
You can see this in Wireshark:

Bad: GET /test3directUpdate/test3/iphone/1.0?skin=default HTTP/1.1
Good: GET /test3/directUpdate/test3/iphone/1.0?skin=default HTTP/1.1

I've opened a defect for this; you will need to create a PMR in order to receive a fix, once available (or wait until it is publicly available via IBM Fix Central / Eclipse Marketplace).