0

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?

Community
  • 1
  • 1
David Dhuyveter
  • 1,416
  • 9
  • 17

1 Answers1

1

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.

nsand
  • 236
  • 1
  • 5
  • I'll stick with the steps for disabling providing library resources for now. I'm not quite sure what the advantage of the default having that enabled is. My guess is that your suggestions would work, but everything seems to be a workaround (including my solution) rather than a fix. – David Dhuyveter Aug 01 '13 at 22:36
  • After further experimentation, it turns out that restarting Eclipse after checking in dojoLib is enough to straighten this out. Evidently Worklight Studio can handle the fact that the dojoLib project isn't in the workspace directory just fine. It is just having the project moved out of the workspace by eGit that confuses it. Restarting Eclipse resolves this. The initial check in of a dojo library should be an infrequent task, so the need to restart Eclipse in this case isn't too bad. – David Dhuyveter Aug 04 '13 at 17:26