Java – Trying to access Lotus DB via Java application – getting error msg ” XXX.nsf has not been opened yet”

javalotus-notes

I'm trying to connect to a Lotus DB from an external Java application – my code works perfectly against a database located on my test (local) server, but fails when run against the production DB (no data is returned).

Diiop is running on the production server, and I have editor access for the production DB.

I'm able to create a session with the Domino server through my Java code, but am not able to open the Lotus DB.

Session session = NotesFactory.createSession("<Server>","UserID","password"); 
System.out.println("connected");
Database db = session.getDatabase("Server","<DB Path>" );
System.out.println("Access level: "+ db.getCurrentAccessLevel());
View vw = db.getView("Viewname");

After creating a session with the Domino server, I attempt to open the database, at which point I get the error XXX.nsf has not been opened yet.

I have also tried utilizing the IsOpen and open methods, with no luck.

Best Solution

Your database will not open in Java code, if its ACL forbids Internet access (that means http task). Check advanced tab of ACL, property "Maximum internet name and password". It should be at least Depositor to open it, or Reader to read data from it.

Related Question