错误访问被拒绝重新加载MFS 7.1中的desktopbrowser环境

时间:2016-04-08 18:36:39

标签: android mobilefirst-server mobilefirst-studio

我做了简单的申请。添加了android和desktopbrowser环境。 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,
    });
}

1 个答案:

答案 0 :(得分: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. Run As - >在MobileFirst Development Server上运行
  6. 在控制台中预览
  7. 我收到了一个显示“成功”的对话框(onSuccess成功回调)。