使用java Notes api打开数据库失败

2023-12-11

我正在尝试使用java程序在本地控制我的lotus Notes自动为我发送电子邮件。我在尝试获取数据库对象时遇到了以下问题。

try {
    NotesThread.sinitThread();
    Session s = NotesFactory.createSession();
    Database db = s.getDatabase("", "mail/xxxx.nsf")
} finally {
    NotesThread.stermThread();
}

我得到以下异常:

NotesException: Database open failed (%1)
   at lotus.domino.local.Database.Nopen(Native Method)
   at lotus.domino.local.Database.open(Unknown Source)

我已将 nsf 文件和 Notes.jar 复制到我的类路径中,有人知道这有什么问题吗?


有几件事需要检查。

第一个改变:

Session s = NotesFactory.createSession();

to:

Session s = NotesFactory.createSession((String) null, (String) null, password);

如果仍然不起作用,则更改:

Database db = s.getDatabase("", "mail/xxxx.nsf")

to:

Database db = s.getDatabase((String) null, "mail/xxxx.nsf")

我还建议养成回收 Domino 对象的习惯。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用java Notes api打开数据库失败 的相关文章

随机推荐