Question

I tried to create a lotus notes client using Java. Now, I have a problem to list all the user defined databases. What I tried to do is

// testing purpose
private void printAllDb() throws NotesException
{
    DbDirectory dir = session.getDbDirectory(host);
    String server = dir.getName();
    if(server.equals(""))
    {
        server = "Local";
    }

    System.out.println("database direcory list on server (" + server + ")");
    Database db = dir.getFirstDatabase(DbDirectory.DATABASE);

    do
    {
        System.out.println("file name: " + db.getFileName().toUpperCase() + " - " + db.getTitle());

    } while((db = dir.getNextDatabase()) != null);

}

However, the program will throw the exception:

Exception in thread "main" NotesException: Server access denied
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._IDbDirectoryStub.getFirstDatabase(Unknown Source)
at lotus.domino.cso.DbDirectory.getFirstDatabase(Unknown Source)
at nz.co.sylresearch.sylsearch.agents.lotusnotes.LotusNotesAPIHandler.printAllDb(LotusNotesAPIHandler.java:58)
at nz.co.sylresearch.sylsearch.agents.lotusnotes.LotusNotesAPIHandler.main(LotusNotesAPIHandler.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Was it helpful?

Solution

The issue is pretty clear. You are getting an access denied error to the server. The tricky part now is figuring out why.

You should start with making sure the username and password used to create the session object is correct. Then make sure that user has access to the server and has access to run Java code on the server. You'll have to check the server document in the Directory for that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top