7/03/2013

Enabling Cross-Server Database Access for XPages

Did you ever encounter a "NotesException: Database has not been opened yet" when trying to open a database on another server from an XPage? This would be something like this:

var db = sessionAsSigner.getDatabase("server","some/database.nsf");
return db.getView("someView");

Here is the solution:

As the XPage is like an Agent on the executing server, you need to put this server into the "Trusted Servers" field in the "Security" tab of the target server's "Server Document", as only agents from servers listed in the "Trusted Servers" can access databases from remote agents.

Here is an example, better use a group for production, as it is more flexible:






No comments:

Post a Comment