1
votes

I am trying to write a Java Code that would connect to my Lotus Notes Email CLient. I have been following this tutorial Writing standalone Java code that connects to IBM Lotus Domino

I have added Notes.jar to my classpath and also added NLSXBE.DLL to the system Path variable. Upon trying to run the code below I get error "java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\IBM\Lotus\Notes\nlsxbe.dll: Can't find dependent libraries"

What else am I missing? Can you just give me a hint pls.

System Spec: Win10, JDK8 32 bit

package main;

import lotus.domino.NotesException;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;
import lotus.domino.Session;
public class Test_Notes extends NotesThread
{
    public static void main(String argv[])
    {
        System.load("C:/Program Files (x86)/IBM/Lotus/Notes/nlsxbe.dll");
        Test_Notes t = new Test_Notes();
        t.start();
    }
    public void runNotes() throws NotesException
    {

            Session s = NotesFactory.createSessionWithFullAccess();
            String p = s.getPlatform();
            System.out.println("Platform = " + p);


    }
}
1
If I'm reading that post right, you're doing local calls, so you need to have either Notes client or Domino server installed on your machine. Is that the case? I don't recall having to have to call System.load() to get my (admittedly brief and not too recent) program to work.Duston
Connect to Notes? Unlike Domino, Notes is not a server application, so I wonder how you imagined that some application should be able to connect to Notes. It's usually Notes that connects.D.Bugger
@Duston I have Lotus Notes 9.0.1 Installed in my Win 10 64bit Laptop .. To run the above program which aims to connect the Lotus notes Client via the Notes API which I have imported in my code using Notes.jar file, I need to load the DLL Dependency. Hence SYstem.load has been used. Other way to load this DLL would be through adding this DLL file's path in System Variable of the LaptopNikhil24
@D.Bugger True that Lotus Notes is a Client Application, but I believe you can create a connection to the Lotus Notes Process which is running in your laptop while the Lotus Notes is open .. Once a session is created you can access the emails via the NSF file of the Notes Client .. Pls refer this stackoverflow.com/a/1616062/8599096 for an example and its also true that Notes can connect to other application and that can be done via Lotus Notes Scripting in Domino Designer but since am comfortable working with Java, I chose the other way round.Nikhil24
I tried viewing what all dependencies are missing for NLSXBE.dll via Dependency Walker and got to know its missing approx 100 DLLs .. Not sure how am I supposed to get those dependent DLLsNikhil24

1 Answers

1
votes

Since you have access to the Notes client, use the JRE that is packaged with the client to execute your Java code - C:\Notes\jvm. This fixed this exact same problem for me. Looks like the DLLs that are needed are in there.

Also, no need to do the System.load(). You can set the VM arg -Djava.library.path=C:\Notes instead.