android - 在 Worklight 8 中使用 WL.Client.connect 连接 Worklight 时出现 500 内部服务器错误
问题描述
我是 worklight 的新手,正在将 worklight 6.2 迁移到 8。我正在尝试使用以下代码连接 worklight,
if (document.addEventListener) {
document.addEventListener('mfpready', function() {
WL.Client.init(wlInitOptions);
WL.Client.connect({ onSuccess: onConnectSuccess, onFailure: onConnectFailure });
angular.bootstrap(document, [ 'App' ]);
WLAuthorizationManager.obtainAccessToken()
.then(
function () {
console.log("*** Obtained token successfully.");
},
function () {
console.log("*** Failed obtaining token.");
}
);
}, false);
document.addEventListener('mfpjsloaded', function() {
WL.Client.init(wlInitOptions);
WL.Client.connect({ onSuccess: onConnectSuccess, onFailure: onConnectFailure });
angular.bootstrap(document, [ 'App' ]);
WLAuthorizationManager.obtainAccessToken()
.then(
function () {
console.log("*** Obtained token successfully.");
},
function () {
console.log("*** Failed obtaining token.");
}
);
}, false);
} else if (document.attachEvent) {
document.attachEvent('mfpready', function() {
WL.Client.init(wlInitOptions); });
}
function onConnectSuccess(result){
console.log("Success to connect worklight :"+JSON.stringify(result));
}
function onConnectFailure(result){
console.log("Fail to connect worklight :"+JSON.stringify(result));
}
但我得到以下错误,
{"status":500,"statusText":"Internal Server Error","responseText":"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>500 Internal Server Error</title>\n</head><body>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error or\nmisconfiguration and was unable to complete\nyour request.</p>\n<p>Please contact the server administrator,\n you@your.address and inform them of the time the error occurred,\nand anything you might have done that may have\ncaused the error.
又面临一个错误,
static_app_props.js:3 Running static_app_props.js...
angular.js:107 ReferenceError: WLResourceRequest is not defined
请引导我解决这个问题。提前致谢。
解决方案
推荐阅读
- ruby-on-rails - 谷歌云 ruby 部署和 ruby-docker
- python - 如何使用 Pandas 替换列中的所有 >x 值?
- javascript - React 'component' argument missing error?
- python - 按字母顺序检查一个词是否在其他两个词之间
- jquery - 获取日期选择器天视图中可见的开始和结束日期?
- c - 在c中初始化结构数组
- java - 错误的第二个参数类型。必需:'android.support.v4.app.Fragment'
- node.js - 如何导出在承诺中创建的数组
- python - word2vec gensim 多种语言
- c# - 如何通过指定主机名标头为 IIS 上托管的网站设置连接字符串