0

I have a Worklight 6.0 project that uses the new Dojo 1.9 libs, I created an external dojo project, like the documentation suggested, then, in the main project properties, under "Dojo toolkit", it references this dojo19 project.

The project works on the local server, then I did "Run As" | "Build for Remote Server...", and entered the correct domain:port and context path, clicked Build, the *.wlapp files were updated. (I've also updated the settings for publicWorkLightHostname / publicWorkLightPort / publicWorkLightProtocol in the "Environment Entries for Web Modules" in the installed war to match the remote server names/port/protocol.)

But, after deploying both war and -all.wlapp file, accessing the app I get JS errors when it tries to refer to the dojo19 library:

    The page at 
https://<myIP>:9443/<myproject>/apps/services/www/ /mobilewebapp/default/IODMobile.html 
ran insecure content from http://localhost:64441/dojo19/<myproject>/IODMobile/mobilewebapp/dojo/nls/core-web-layer_en-us.js.

The dojo19 is the project name in my Worklight developer workspace that I referred to above.

Why is it trying localhost? Seems there's a missing step here in deploying the dojo library project into Worklight.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
DavidW
  • 45
  • 9

2 Answers2

0

Where are you trying to preview the application when you get the error message?

Partial copy/paste:

Step 1: Verify your application works in the Mobile Browser Simulator with Provide Library Resources checked. If the Console log is showing resources being served from the server, then these have to be copied to your application before deploying to AVD or a device

Step 2: After you think you have all Dojo/resources within your project, uncheck Provide Library Resources and test it again in MBS. If it fails in MBS, then something is missing in your application that is in the library/server. You can check Provide Library Resources and retest to see if it shows you what that is. Not all resources are shown, e.g. if there's a missing CSS file.

Also I would suggest to do all of this in the Development environment (that is, in Eclipse) before starting to deploy the .war file and .wlapp file etc... (which, BTW, I hope you're doing based on the new instructions for Worklight 6.0)

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • I took the url from the "Get App URL" on the console, so, I'm trying to view it from the production Worklight install. And, yes, I'm following the instructions from the Worklight 6.0. – DavidW Jul 18 '13 at 17:10
  • Get App URL... so this is the Mobile Web environment? In any case can you verify whether steps 1 and 2? have you done anything or tried this? – Idan Adar Jul 18 '13 at 17:25
  • Also, the project works fine with the local Mobile Browser Similator from the Worklight Developer environment. The "Console" log doesn't show any resources "served from the server" (or, much of anything). – DavidW Jul 18 '13 at 17:26
  • What about in the development environment, in Eclipse, when you preview the app as well as using the get app url, does it work or fail the same way? – Idan Adar Jul 18 '13 at 17:29
  • Also, this is a Mobile web app, I don't see a "Provide Library Resources" checkbox. – DavidW Jul 18 '13 at 17:29
  • Page 19: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v600/03_03_Working_with_UI_frameworks.pdf – Idan Adar Jul 18 '13 at 17:31
  • I used the full app url (obtained from the "Get App URL" from the local Worklight, and, this also works without any problem. Just looks like its when deploying. – DavidW Jul 18 '13 at 17:33
  • I see on page 19 the link, I've removed the check on the "Provide Library Resources", and, now I'm getting similar errors in the JS log: http://localhost:53865/dojo19/MobileEMS/IODMobile/mobilewebapp/dojo/nls/core-web-layer_en-us.js. Would like to send you a print screen of my configuration, but, stackoverflow doesn't seem to handle this on replies. My "dojo.workspaceRoot is set to //www and the dojo directories (dojo/dojox/layers) are in a folder in the project under www. Hope that helps. – DavidW Jul 18 '13 at 19:33
  • I don't see the iFix, where can I get it? – DavidW Jul 19 '13 at 13:34
  • I believe simply checking for updates in Eclipse will find it – Idan Adar Jul 19 '13 at 13:40
  • No, this doesn't find any. – DavidW Jul 19 '13 at 13:44
  • 1) Billy may be referring to a future iFix. 2) Where from did you download and install Worklight? I had mine installed from the Eclipse Marketplace and checking for updates now I did get a new update notification for my 6.0 installation; new version is 6.0.0.20130711 – Idan Adar Jul 19 '13 at 13:56
  • Found the fix on Fix Central,but,it's only available to Passport or if you have a service request, we're business partners (and IBM contractors), how can we get it? – DavidW Jul 19 '13 at 14:14
  • Installed from a local repository, downloaded from our subscription to software as business partners. – DavidW Jul 19 '13 at 14:16
  • Then AFAIK it should be available at [IBM Partner World](http://www-304.ibm.com/partnerworld/wps/servlet/ContentHandler/pw_home_pub_index). – Idan Adar Jul 19 '13 at 14:18
  • Got the download link from Eclipse Marketplace, and installed the iFix, but, still same issue. – DavidW Jul 19 '13 at 14:37
  • Don't know then. Too many comments and I don't know where you're testing this. I suggest that you start afresh, get a basic Dojo project up and running in Worklight 6.0 in Eclipse and build it up. Once it's ready and still working, start to export the files and run them on an application server. – Idan Adar Jul 19 '13 at 14:41
  • We're testing this on both places (dev and test server), not sure where the confusion is. It works in the dev environment, but, when we deploy to our test server, it doesn't change the references from "localhost". And, this is a "basic" dojo project, there isn't anything special that we know of. – DavidW Jul 19 '13 at 16:06
0

In the information center, it will show you how to uncheck the Provide Library Resources in the Console Log.

I think what you're running into is: 1) Something is being served from the Dojo Library/Server 2) A bug in 6.0 that used "localhost" instead of the IP of the host (your machine running eclipse). This is fixed in the 6.0 iFix. With this fix, you can run your app external to Studio and still use the Dojo Library/Server. Without this fix, you must have everything you need within your app.

Can you install the iFix and let us know if that fixed the problem?

Billy Rowe
  • 71
  • 2
  • The DOJO libs are also within the app (doesn't look like there's a way NOT to define an external DOJO library, is there?). Seems that "Build for Remote Server" should take care of all of this, shouldn't it? – DavidW Jul 19 '13 at 13:58
  • Installed the icix, same issue. Also, we have the "pre-built" dojo libs local in the project, and, after installing on the server, it can't find the dojo libs (observerable.js is first error). – DavidW Jul 19 '13 at 14:36