我的Lotus网络包含多个Lotus Domino服务器(每个组织单位都有自己的服务器)。我试图连接到Server_A,然后使用names.nsf从Server_B获取getDatabase()

Session session = NotesFactory.createSession("Server_A_IP:63148", superuser, pass);

Database names = session.getDatabase("CN=Server_B/O=Organization", "names.nsf");


错误我得到:

Exception in thread "main" NotesException: Database CN=Server_B/O=Organization!!names.nsf has not been opened yet
    at lotus.domino.NotesExceptionHelper.read(Unknown Source)
    at lotus.domino.NotesExceptionHolder._read(Unknown Source)
    at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
    at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    at lotus.domino.corba._IDatabaseStub.searchU(Unknown Source)
    at lotus.domino.cso.Database.search(Unknown Source)
    at lotus.domino.cso.Database.search(Unknown Source)


使用names.nsf打开session.getDatabase(null, "names.nsf");可以正常工作。

最佳答案

NotesFactory.createSession(“ Server_A_IP:63148”,超级用户,通过);

-> NotesFactory.createSession(“ Server_A_IP”,超级用户,通过);

您不需要端口号

您可以查看http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=%2Fcom.ibm.designer.domino.main.doc%2FH_EXAMPLE_REGISTERNEWUSER_METHOD_JAVA.html

您还应该测试您的会话不是空对象...
如果(session!= null){

}

10-05 22:18