erratic failure of sessionAsSignerWithFullAccess

三世轮回 提交于 2019-12-24 13:33:22

问题


The code below is a some test code that I have in an action button on an XPage. I need to get a handle on the current database with FullAccess in the code WFSUtils.sysOut just formats a printed message to the server console. Periodically the error message in the catch returns 2015-01-09 12:49:11 PM HTTP JVM: WFS ~~~ Error in Update Demo 'sessionAsSignerWithFullAccess' not found

I am the signer of the XPage and the database is signed by the server ID. Sometimes it runs through just fine other time it fails with the message above. If I shut everything down then restart it will generally run but then start failing. It is very random and unpredictable.

debug = true;
try{

    if (debug) WFSUtils.sysOut("Starting YYY New SetupDemo");
    var serverName = database.getServer();
    var repID = database.getReplicaID();
    thisDB = sessionAsSignerWithFullAccess.getDatabase("","");
    thisDB.openByReplicaID(serverName,repID); 
    if (debug) WFSUtils.sysOut( "SetupDemo Success" + thisDB.getTitle());
}catch(e){
    WFSUtils.sysOut("Error " + e.toString())
}finally{
    try{
        WFSUtils.recycleObjects([]);
        if (debug) WFSUtils.sysOut("SetupDemo Recycle Success");
    }catch(e){
        if (debug) WFSUtils.sysOut("SetupDemo recycle Failed");
    }

}

回答1:


For one reason or another, it's important that all XPage elements be signed by the same ID when running. When they're not, sessionAsSigner and sessionAsSignerWithFullAccess get erratic as you describe - that may be the cause.



来源:https://stackoverflow.com/questions/27868299/erratic-failure-of-sessionassignerwithfullaccess

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