0

I'm using Worklight v6.1 and i'm facing an issue on deploying my app to Windows 8, the reproduction steps are the following:

  1. added the Windows 8 environment to the Worklight application
  2. built the application using worklight production server settings, verified the correct working
  3. copied native folder to a Windows 8 pro x64 environment, opened its .jsproj file using Visual Studio 2012 Ultimate
  4. when i run this application using the Win8 simulator i get the 0x2efd error, followed by other errors as impossibile to add dynamic content and Host is not responsive, obviously the app doesn't work.

the .html file contains the correct reference to the Worklight production, from a web browser installed in Windows8 pro x64 i can reach correctly the production server.

the manifest file contains the following capabilities:

 <Capabilities>
    <Capability Name="enterpriseAuthentication" />
    <Capability Name="internetClientServer" />
    <Capability Name="internetClient" />
    <Capability Name="privateNetworkClientServer" />
  </Capabilities>

here is a screenshot of the javascript project's visual studio console: https://i.stack.imgur.com/Ukwey.png

Worklight static properties are shown here:

WL.StaticAppProps = {
   "APP_DISPLAY_NAME": "jqueryExtendedApplication",
   "APP_ID": "jqueryExtendedApplication",
   "APP_SERVICES_URL": "http:\/\/172.17.196.140:9080\/worklight\/apps\/services\/",
   "APP_VERSION": "1.0",
   "ENVIRONMENT": "windows8",
   "LOGIN_DISPLAY_TYPE": "embedded",
   "WORKLIGHT_PLATFORM_VERSION": "6.1.0.00.20131219-1900",
   "WORKLIGHT_ROOT_URL": "http:\/\/172.17.196.140:9080\/worklight\/apps\/services\/api\/jqueryExtendedApplication\/windows8\/"
};

as stated previously i am able to access the Worklight console from a web browser using this link: http://172.17.196.140:9080/worklight/console/#catalog

Added successfully the mobile web environment, as with all the other environments i get on loading a message box stating that the application is trying to access to Worklight server for looking for available updates(if i don't set connect on startup to true i don't get it). the preview url is http://172.17.196.140:9080/worklight/apps/services/preview/jqueryExtendedApplication/mobilewebapp/1.0/default/jqueryExtendedApplication.html

if it can be useful: my app's layout doesn't fit properly to any screen, both in production and develoment environment: enter image description here

i created an empty windows8 app , added jquerymobile 1.3.2 and deployed, the development server can't load it, the production server succeeds on loading but gets stuck showing a rotating gear: enter image description here

Update: without adding JQM the empty app works. I think this could be the issue for the other applications. isn't JQM v1.3.2 supported by windows 8 environment? sounds weird..

Riccardo
  • 1,490
  • 2
  • 12
  • 22
  • When you say "from a web browser installed o Win 8 i can reach correctly the production server" - do you mean you are able to load Worklight Console? See if you can load the console - this is the real test whether your Worklight Server is reachable or not. – Idan Adar Jan 10 '14 at 14:04
  • it's exactly as you say, i can load the production server's Worklight console from any browser installed in Windows8 pro x64. – Riccardo Jan 10 '14 at 14:29
  • No... wait, you say in step 3 that you have copied the native folder to the windows 8 machine. So in the machine where you generated the native folder you have pointed it to the worklight server in the windows 8 machine; but did you also deploy the .wlapp via the console in the windows 8 machine? – Idan Adar Jan 10 '14 at 14:31
  • I have 2 machines, one contains the Worklight server(and it's a Windows7 machine), the other one is a Windows8 machine. i don't have visual studio in the Windows7 machine. i deployed the .wlapp using this one, after i copied the native folder in the WIndows8 machine, opened the .jsproj file using visual studio and run the simulator to test the appliction. In the Windows8 machine i tried to reach the Worklight console of the WIndows7 one and i did it successfully. – Riccardo Jan 10 '14 at 14:36
  • Okay. That sounds about right. Need to think about it... – Idan Adar Jan 10 '14 at 14:38
  • if it helps.. i just verified that there isn't any request blocked by a firewall. – Riccardo Jan 10 '14 at 14:50
  • 1
    Can you reach the Worklight console from a browser running in the Win8 **simulator**? I've seen cases where the simulator's network stack doesn't connect to the internet … or doesn't connect quickly enough and the app can't reach the server, even though the HOST OS can reach the server with no problem. – David Dhuyveter Jan 10 '14 at 15:04
  • @DavidDhuyveter yes i can reach the WL Production server from a browser running in the simulator. i tried also to run the application straight on the host but got the same result. – Riccardo Jan 10 '14 at 15:12
  • Can you add screen shots to clarify the exact errors you see in Visual Studio? – Idan Adar Jan 10 '14 at 18:49
  • @IdanAdar here is the javascript console's screensshot https://www.dropbox.com/s/a199dj00rcirg0w/Schermata%202014-01-11%20alle%2013.06.13.png, hope you don't mind there are some descriptions in italian. if so please tell me. – Riccardo Jan 11 '14 at 12:36
  • The URL gives me error 500; upload the images to imggur or alike and edit the question with links to the images. – Idan Adar Jan 11 '14 at 14:50
  • it's weird, i get it working, anyway http://i.imgur.com/iyxLVZq.png – Riccardo Jan 11 '14 at 18:18
  • Okay, the error is weird... What are you doing in your app? Is this a blank NEW app? Because it is calling wl.client.connect TWICE, which normally would not happen in a new app... – Idan Adar Jan 11 '14 at 18:52
  • it's not a blank new app, it's a simple app that connects to the production server at startup, displays a request form and fetches data using two sql adapters displaying the fetched rows in a listview. It works correctly on Android, iOS environments. – Riccardo Jan 12 '14 at 17:53
  • 1) What is the URL that you use in order to connect to Worklight Console from the Windows 8 machine? 2) What is server URL that you usee in Visual Studio in the HTML file of the application? – Idan Adar Jan 13 '14 at 09:02
  • Thanks. Also, if you can add the Mobile Web environment and use the URL you get for it (from the console) and see if it loads or not. – Idan Adar Jan 13 '14 at 09:11
  • done, if you need additional information please tell me. – Riccardo Jan 13 '14 at 09:18
  • Can you try with a new application that does nothing other than connectOnStartup: true? If this fails as well, you have a networ problem between the two machines somehow. I have created a new app for Windows 8 in my Windows 7 machine (which runs the Worklight Development Server); I then copied the native folder to the Windows 8 machine, both are in the same network, I then built it in Visual Studio and the app managed to connect to the server... – Idan Adar Jan 14 '14 at 12:05
  • @IdanAdar i tried what you say, disabled the connectOnStartup option and tried, the behaviour is different but as expected i get an error when try to connect to SQL adapters(as expected becouse it can't connect to the server so to backend services too). I noticed two things: my windows8 app layout doesn't fit to the screen( see the snapshot on my edited answer), this happens using both development and production server, and only with windows8 apps. – Riccardo Jan 23 '14 at 10:48
  • The layout doesn't matter... that's something you need to adjust in your CSS. – Idan Adar Jan 23 '14 at 11:30
  • please see my edited question, found something about JQM. – Riccardo Jan 23 '14 at 11:31
  • about layout, i agree with you i can change it using css, but with all the other environments applications fits well on all screen without changing any style settings.. – Riccardo Jan 23 '14 at 11:32
  • by the way, without using JQM library my application's layout fits perfectly. – Riccardo Jan 23 '14 at 11:38
  • I do not know the level of support JQM 1.3.x has with Windows 8; you will need to consult with jQuery Mobile's documentation. – Idan Adar Jan 23 '14 at 11:42
  • ok, but i deployied my empty app(no JQM) to the production server and i can't connect to the worklight server(either for updates and adapters) from the machine where my app is installed, i think this depends from jQuery issue too(the onload event is handled using jQuery). What can i do? – Riccardo Jan 23 '14 at 20:05

2 Answers2

1

There are well known problem with JQM and Win8 Store Apps. (see: Windows 8 Phonegap Application JQuery Mobile Security Exception)

There are workarounds that involve editing JQM to disable the extra security checks on Win8, but I have yet to see anyone comment on whether that opens a real security hole, so I've avoided them.

I've seen suggestions of editing JQM to wrap everything causing problems in toStaticHTML(), but folks claim that that solution breaks other stuff, so I haven't followed up that path

I've successfully built a JQM Win8 Store app in the past by creating a full screen iframe, and loading the UI in the Web Container rather than in the App container. (using ms-appx-web:// rather than ms-appx as the uri scheme for the root document) That worked, but it was a royal pain because all communication with Worklight had to be proxied out to the parent window via events.

I don't know that there is a good solution to this problem short of building a custom mobile framework for Windows 8 store app.

Community
  • 1
  • 1
David Dhuyveter
  • 1,416
  • 9
  • 17
  • hi David, i understand there are issues concerning JQM and Windows8 metro apps, but i created and deployed a simple empty app, enable the 'ConnectOnStartup' option and my app can't connect to the production server(which i tested it is reachable from the machine). I can understand JQM may have some issues but not the Worklight server. what should i do? – Riccardo Jan 23 '14 at 12:46
1

I first addressed this problem to the Worklight connection protocol, after deep analysis and through various experiments and tests i figured out that it's an issue addressable to the weird behaviour of Cisco VPN client and Windows8 metro app. The same application running as a metro app have connectivity issues, running from any desktop browser it works well though.

Here some links i found helpful:

detailed description

this solution works for me

Solution is straight forward, i installed Fiddler2 with the AppContainer Loopback Exemption Utility, selected all apps installed and exempted all apps from being blocked by the OS from sending network traffic to the local computer.

Riccardo
  • 1,490
  • 2
  • 12
  • 22