External Java to Notes UnsatisfiedLinkError (nlsxbe.dll)

Hi,

I am trying to establish a Notes session from a Java program running external to Notes and I can’t even get an example from Designer 7 Help to work.

Example 3 (static NotesThread technique) from topic “Running a Java Program” bombs on the following line of code…

Session s = NotesFactory.createSession();

…with the error:

Exception in thread “main” java.lang.UnsatisfiedLinkError: C:\lotus7\notes\nlsxbe.dll: The specified procedure could not be found

at java.lang.ClassLoader$NativeLibrary.load(Native Method)

at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2120)

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1998)

at java.lang.Runtime.loadLibrary0(Runtime.java:824)

at java.lang.System.loadLibrary(System.java:908)

at lotus.domino.NotesThread.load(Unknown Source)

at lotus.domino.NotesThread.checkLoaded(Unknown Source)

at lotus.domino.NotesThread.stermThread(Unknown Source)

at platform3.main(platform3.java:22)

I have read everyone’s tips on this forum regarding this problem and have also reviewed the Designer 7 Help topic “Running a Java program” as well as the “Java acess to the Domino Objects, Part 1” article from IBM that one forum posting linked to, but I still have a problem.

Here are some details of my configuration:

o Attempting a local connection on my PC which has Lotus Notes/Designer/Admin clients installed.

o Classpath contains Notes.jar and NCSO.jar (as well as a period for current directory):

CLASSPATH=.;C:\lotus7\notes\jvm\lib\ext\Notes.jar;C:\lotus7\notes\data\domino\java\NCSO.jar

o PATH contains C:\lotus7\notes and C:\lotus7\notes\jvm\bin (this second path is not documented but I someone on this forum suggested it).

o I registered the nlsxbe.dll file via steps contained in this post…

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/8fd7049bfd6f0c5c85256e860055739d?OpenDocument&Highlight=0,nlsxbe.dll

I must be missing some configuration step. I have tried this both from within Rational Web Developer as well via the “java” command issued at an MS-DOS command prompt.

Anyone have a suggestion?

Thanks in Advance,

Ken A Collins

New York City

Subject: External Java to Notes UnsatisfiedLinkError (nlsxbe.dll)

Your runtime should have either Notes.jar or NCSO.jar in the classpath, but not both. Notes.jar is used for local connections, NCSO.jar for remote (i.e. to diiop) – try removing NCSO.jar…

  • Erik

(in NYC too…)

Subject: RE: External Java to Notes UnsatisfiedLinkError (nlsxbe.dll)

Erik,

Thanks for your response. Actually, all documentation I have read says that it does not hurt to have both Notes.jar and NCSO.jar in the classpath. Just the same, I removed NCSO.jar and tried again. It still bombed with the same error.

Maybe I am making a bad assumption here, but I am of the belief that support for local calls includes my own local Lotus Notes client and not just going after a Domino server running on the same box. Am I correct or not? Ultimately, I will be installing this on a computer running a Domino server and accessing that server via remote calls so that I can enforce authentication, but for starters I just want to see if I can establish a Notes session on my own developer PC which I thought was possible.

Ken

Subject: Solved: External Java to Notes UnsatisfiedLinkError (nlsxbe.dll)

For the benefit of anyone out there who might read this thread, I opened a PMR with IBM and it took a solid week of troubleshooting before we finally unearthed the cause of the problem – it was with my PATH statement.

I had a lot of programs in my PATH and the C:\Lotus\Notes reference was at the end. It turned out that another program appearing earlier in my PATH, Corel SVG Viewer, references procedures by the same name as Notes Java was trying to access in nlsxbe.dll, so the Notes Java code was finding the Corel one first.

The way we determined this was to change the PATH temporarily in a command prompt window, setting it to ONLY include the JVM and the C:\Lotus\Notes program directory and C:\Lotus\Notes\Data data directory. When the platform3.class ran successfully, I then restored the original full blown PATH (again only doing so within the command prompt window) and started removing one file path at a time and rerunning the Java class until I figured out which path caused the conflict.

I thought this meant that I would find another copy of nlsxbe.dll elsewhere on my machine and in a folder listed earlier in my PATH variable, but this was not the case. The nlsxbe.dll file only resides within Notes. My co-worker explained something to me about DLLs that I didn’t know, namely that a DLL file is just a library of procedures (like a LotusScript script library) and that there must be a conflict in another DLL file over a procedure that has the same name as the one the Java / Notes environment seeks to find in nlsxbe.dll.

After I identified the culprit a C:\Corel SVG Viewer, I altered my PATH environment variable permanently via Control Panel and placed this Corel folder after C:\Lotus\Notes. This may break Corel SVG Viewer, but I don’t care, it’s not a tool I have used in ages. Through additional experiments, I found that I did not need to include the Notes Data directory C:\Lotus\Notes\Data.

Ken