1

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");
    }

}
Bill F
  • 2,057
  • 3
  • 18
  • 39

1 Answers1

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.

Jesse Gallagher
  • 4,461
  • 13
  • 11
  • I have heard that but ensuring that there is a single signer of a database is pretty difficult particularly in a development environment. For whatever reason I have found that when I get that error then close the designer then open the XPage and execute the code it generally works, but not always. Very strange and very time consuming. – Bill F Jan 09 '15 at 22:46
  • I signed the DB with my ID and now it works. So while developing should probably be signed by the person then sign it with the server in production. – Bill F Jan 10 '15 at 21:59