我正在尝试获取服务器上的所有数据库。但是在 getDbDirectory()
参数中将我的服务器名称指定为 NALLN304/40/LLN/IBM 会出现错误。
Directory NALLN304/40/LLN/IBM!! does not exist
它总是在末尾添加两个感叹号。我还尝试在邮件文件末尾添加 .nsf 格式作为服务器名称和邮件文件。 NALLN304/40/LLN/IBM!!data0\126\1000031540.nsf
也给了我同样的错误。
下面的截图代码:
Session session = null;
Database db = null;
DbDirectory dir = null;
try
{
NotesThread.sinitThread();
session = NotesFactory.createSession();
System.out.println("User = " + session.getUserName());
dir = session.getDbDirectory("NALLN304/40/LLN/IBM");
System.out.println(dir.getName());
db = dir.getFirstDatabase(DbDirectory.DATABASE);
do
{
System.out.println("Title: " +db.getTitle());
}
while(dir.getNextDatabase() != null);
}
catch(NotesException ex)
{
ex.printStackTrace();
}
错误总是指向 db = dir.getFirstDatabase(DbDirectory.DATABASE);
因为 dir.getFirstDatabase(DbDirectory.DATABASE)
即使我也需要 .nsf 文件指定文件格式。我收到此错误的原因是什么?
最佳答案
您的问题是您的 ID 未通过服务器进行身份验证。您需要从这一行获取输出:
System.out.println("User = " + session.getUserName());
并将其交给您的服务器管理员,询问为什么不允许访问服务器,并要求他们通过授予必要的权限或为您提供另一个可以使用的 ID 来帮助您。
关于java - 目录不存在(Lotus Notes),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46050067/