David Dhuyveter
David Dhuyveter

Reputation: 1416

Worklight Studio v6 dojo apps break if you check dojolib into git repository

I start with a trivial dojo application. I view the application in a browser as common resources and it runs with no errors. I check dojolib into a git repository using the eclipse git tooling, and now my app fails with the errors:

GET http://172.16.233.1:50821/dojoLib2/Test01/Test01/common/dojo/nls/core-web-layer_en-us.js 404 (Not Found) dojo.js:20
GET http://172.16.233.1:50821/dojoLib2/Test01/Test01/common/dojo/nls/mobile-ui-layer_en-us.js 404 (Not Found) dojo.js:20
Error {src: "dojoLoader", info: Array[2]}
dojo.js:21
Error {src: "dojoLoader", info: Array[2]}

I followed the instructions to disable providing library resources found here:

IBM Worklight 6.0 - Unable to run sample hybrid worklight app using dojo toolkit for android environment on avd?

and once again the app runs without errors. Is that the expected behavior?

Upvotes: 0

Views: 287

Answers (1)

nsand
nsand

Reputation: 236

The expected behavior is that disabling "provide library resources" will cause your application to utilize only what is local and it removes some development instrumentation that wires up the Dojo library. So yes, we would hope to see that this error would go away in this case.

It looks like that with egit, sharing with a repository actually moves the resource out of the workspace's filesystem directory. Because of this, the requested library resources (core-web-layer_en-us.js and mobile-ui-layer_en-us.js) are not resolved by the server that is supposed to provide them (because those files are no longer physically at that filesystem location).

One possibility would be to reimport the dojo library project from your git repository after sharing it. Start by deleting the dojo library project from your workspace, and in the dialog that pops up, make sure "Delete project contents on disk" is unchecked. Click OK to delete the project. Then use File > Import... Choose Existing Projects into Workspace. Browse to your repository as the root directory and in the Projects table, choose your dojo library. Check Copy projects into workspace and click Finish. While your changes to your dojo library may not be reflected, it should at least fix the 404 errors that you're seeing.

Upvotes: 1

Related Questions