0

I have recently started exploring IBM Worklight which looks really promising to build hybrid mobile apps, in order to do so, created a Worklight project while choosing Dojo Toolkit as a default framework choice and got to see the missing dojo/main.js issue.

Here is the HTML code:

<!DOCTYPE HTML>
<html>
<head>
<title>TD_Mobile</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">

    <script src="dojo/dojo.js" data-dojo-config="isDebug: false, parseOnLoad: true, async: false"></script>

<link rel="stylesheet" href="css/TD_Mobile.css">
</head>
<body id="content" style="display: none;">
    <div data-dojo-type="dojox.mobile.ScrollableView" id="view0"
        data-dojo-props="selected:true"></div>

TD_Mobile
    <!--application UI goes here-->
    <script src="js/initOptions.js"></script>
    <script src="js/TD_Mobile.js"></script>
    <script src="js/messages.js"></script>
</body>
</html>

When I do build and deploy and run the project from worklight console as a common resource, got to see the main.js not found issue at the following path http://localhost:8080/apps/services/preview/TD_Mobile/common/1.0/default/dojo/main.js

And to my surprise further, I was able to search the reference folder at C:\Users\marif\workspace\WorklightServerHome\TD Mobile New\widget-resources\TD_Mobile-common-e6cd3d9088c88e96df743ed1c9a1b584a90da8c9\preview\default\dojo and don't see main.js and some more JS files there.

Looks like final deployed build somehow not working properly, would appreciate for any quick pointer.

Charles
  • 50,943
  • 13
  • 104
  • 142
Mohammad Arif
  • 6,987
  • 4
  • 40
  • 42

2 Answers2

1

Not all files are included in the dojo build, there is a file called build-dojo.xml in your project. Add main.js to it.

Under <patternset id="dojo.resources.loose-modules"> add the modules you want to use.

tik27
  • 2,698
  • 1
  • 16
  • 25
0

This sounds like a write permissions issue. Can you please create a new project and see if it happens there as well? If it does not then the issue is solved, else it might be a plugin issue. Do you get any error message is the Worklight console in the build process?

Raanan Avidor
  • 3,533
  • 4
  • 25
  • 32
  • Have tried out creating another projects as well but getting the same issue again. First time it works but when I do change the data-dojo-config as given then it starts creating issue. You could see, have enable the debugging and did the async false and that's where problem start coming in. By the way, there is no error comes up in Worklight console. – Mohammad Arif Jan 22 '13 at 04:44
  • 1
    Have been discussing the same on IBM Worklight forum as well, you could get the uploaded zip with all files contents in it, in order to run and check @ https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14931466 – Mohammad Arif Jan 22 '13 at 04:47