【问题标题】:Error Access Denied Reload for desktopbrowser environment in MFS 7.1MFS 7.1 中桌面浏览器环境的错误访问被拒绝重新加载
【发布时间】:2016-04-08 18:36:39
【问题描述】:

我做了简单的应用程序。添加了 android 和 desktopbrowser 环境。安卓应用运行良好。

在预览桌面浏览器环境时,无限次出现错误访问被拒绝重新加载对话框。

在“worklight.properties”文件中进行了以下两项更改。

mfp.session.independent=false

mfp.attrStore.type=HttpSession

尝试重启服务器和eclipse。

复制代码如下:

function wlCommonInit(){

    WL.Client.connect({
                onSuccess: onConnectSuccess,
                onFailure: onConnectFailure
            });

}

function onConnectSuccess(){
    alert("Connected to Server");
    WL.Client.checkForDirectUpdate();

}

function onConnectFailure(){
    alert("Connection Failure");
}

$("p").click(function(){
    alert("Paragraph Clicked");
    getData();
});

function loadFeedsSuccess(result){
    invocationResult = result.invocationResult;
   alert(JSON.stringify(invocationResult.firstName));
   alert(JSON.stringify(invocationResult.lastName));
}

function loadFeedsFailure(error){
   console.log("Feed retrieve failure");
   alert(JSON.stringify(error));
   alert("Feed retrieve failure");
}


function getData() {
    var invocationData = {
            adapter : 'Test',
            procedure : 'getAdapter',
            parameters : []
        };

    WL.Client.invokeProcedure(invocationData,{
        onSuccess :  loadFeedsSuccess,
        onFailure : loadFeedsFailure,
    });
}

【问题讨论】:

  • 当您使用 chrome 检查器时,您是否在 javascript 控制台中看到任何问题?
  • FWIW,我能够将上述代码复制/粘贴到具有桌面浏览器环境的新创建的 MFP 7.1 混合应用程序中(通过将其放入 main.js),对工作灯进行了指示的更改。属性,并且在我的环境中它可以正常工作。查看开发服务器日志中的内容(在“MobileFirstServerConfig/servers/worklight/logs”中的 Eclipse 工作区目录下)可能会很有趣。
  • 控制台获取为:wlclient init 之前开始:initOptions.onSuccess 请求 [/Test/apps/services/api/Test/desktopbrowser/init] 应用程序详细信息标头:{"applicationDetails":{"platformVersion
  • 你能把你的主机名改成你的实际IP地址再测试一下吗?

标签: android mobilefirst-server mobilefirst-studio


【解决方案1】:

我无法重现这个。

  1. 在 IBM MobileFirst Platform Studio 7.1.0.00-20160321-2138 中创建了一个新项目
  2. 在 server\conf\worklight.properties 我设置了mfp.attrStore.type=HttpSessionmfp.session.independent=false
  3. 添加了移动网络环境
  4. 在 main.js 中添加了 WL.Client.connect() 的代码 -> wlCommonInit()
  5. 运行方式 -> 在 MobileFirst 开发服务器上运行
  6. 在控制台中预览

我得到一个显示“成功”的对话框(onSuccess 的成功回调)。

【讨论】:

  • 谢谢伊丹。我再次尝试相同。这次我添加了移动 Web 环境和桌面浏览器。但在两种环境中仍然出现相同的错误。我正在使用 Eclipse Marketplace 中提供的 IBM MobileFirst Platform Studio 7.1.0.00-20160401-2103。请告诉我我是否在错误版本的 Mobile First Studio 中工作。
猜你喜欢
  • 2021-04-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-01
  • 2015-03-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多