IBM Worklight with Dojo Toolkit | dojo/main.js 404 not found issue

岁酱吖の 提交于 2020-01-03 05:47:11

问题


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.


回答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.




回答2:


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?



来源:https://stackoverflow.com/questions/14434503/ibm-worklight-with-dojo-toolkit-dojo-main-js-404-not-found-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!