我正在尝试从我的 Java Web 应用程序连接 Lotus Notes(8.5.1) 数据库(在数据库 ACL 中默认使用编辑器访问)。我按照此说明http://www.ibm.com/developerworks/lotus/library/ls-Java_access_2/通过 CORBA DIIOP 远程连接 Lotus notes 数据库。基本上我将 NCSO.jar 添加到我的 eclipse 的 java 路径中,并按照说明中的说明设置服务器文档。这是我从头开始的java源代码:import lotus.domino.*; 公共类 CORBAconnect {
public static void main(String[] args) {
try {
String host = "devs2:63148";
Session s = NotesFactory.createSession(host);
//I also tried this with userid and password below, the userid and password is not valid.
//Session s = NotesFactory.createSession(host, "jsmith", "js4533");//
String p = s.getCommonUserName();
System.out.println(p);
Database db = s.getDatabase("devs2", "apps/dev/market.nsf");
System.out.println(db.getFilePath() );
} catch(Exception e) {
e.printStackTrace();
}
}
}
运行 java 代码后,我可以看到 Anonymous 打印在 Eclipse 控制台上,但出现 NotesException: User Anonymous cannot open database 错误。我也尝试添加我的用户名和密码,但我得到了 NotesException: Invalid user name/password。我也看到有人发布了同样的问题,但还没有解决方案。顺便说一句,Domino 目录上服务器文档上的 DIIOP 选项卡将匿名选项设置为是,有人可以帮助如何使连接正常工作吗?理想情况下,我不想在 createSession 上添加用户 ID 和密码。但是如果没有选项,那么我会使用,但是现在,无论有没有用户名和密码都不起作用。请让我知道我应该在多米诺服务器部分或 java 部分上设置的任何地方。谢谢