HTTP JVM: java.lang.UnsatisfiedLinkError: Can't find library ocijdbc9 (ocijdbc9.dll) in java.library.path

Hi,

“HTTP JVM: java.lang.UnsatisfiedLinkError: Can’t find library ocijdbc9 (ocijdbc9.dll) in java.library.path.” -

this is the error I get trying to run Java agent that envokes oracle stored procedure. It was writen a few years ago (http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/9badc27cc1d0429485256bf2003d8b6c?OpenDocument)

and worked fine till now on Domino 5 and Oracle 8. Now we moved to Domino 6.5 and Oracle 9 and it fails saying:

HTTP JVM: java.lang.UnsatisfiedLinkError: Can’t find library ocijdbc9 (ocijdbc9.dll) in java.library.path java.library.path=C:\Lotus\Domino;.;C:\WINDOWS\system32;C:\WINDOWS;c:\oracle\ora92\bin;C:\oracle\ora92\lib;C:\IBM\MQseries\Java\lib;c:\oracle\ora92\jre\1.4.2\bin\client;c:\oracle\ora92\jre\1.4.2\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IBM\Director\bin;C:\Program Files\BCN=lotustest1/O=Mehish

on this row:

Connection conn = DriverManager.getConnection (“jdbc:oracle:oci8:@dbc-name”, “user”, “password”);

despite of fact that ocijdbc9.dll exist under c:\oracle\ora92\bin and Domino service user has full rights on that folder. Copying of that dll to Domino folder or to windows/system32 folder just crash the server at the agent run.

On the other hand simple Java program with same contents like the agent works fine when runned by java.exe located under: C:\Lotus\Domino\jvm\bin (same one that runs the agent, right?).

I also tried to mix Lotus Script with Java (LS2J) and wrote an agent that use that simple Java program that worked before, but guess what happened?! Right - when Java program reached that problematic “getConnection” row - it failed again with the same error!!!

Please advise how to make it work.

Thank you,

Y.M.

P.S. I also tried to move back to Lotus Script stored procedure calls - nothing. Just error msgs saying “PLS-00306: wrong number or types of arguments in call to ‘PROC_NAME’”.

I have to pass one text param and get back two and I did it like this:

Dim session As New NotesSession

Dim sesslc As New LCSession

Dim src As New LCConnection (“oracle8”)

Dim fieldsIn As New LCFieldList

Dim fieldsOut As New LCFieldList

Dim fieldIn As New LCField (1, LCTYPE_TEXT)

Dim fieldOut1 As New LCField (1, LCTYPE_TEXT)

Dim fieldOut2 As New LCField (1, LCTYPE_TEXT)

Dim Count As Long

sesslc.ClearStatus

src.server = “server”

src.Userid = “user”

src.Password = “pwrd”

src.Procedure = “DBATEAM.SESSIONS_MANAGEMENT.GETID”

src.connect

Set fieldIn = fieldsIn.Append(“in1”, LCTYPE_TEXT)

fieldIn.text = “‘1234567’”

'i have tried next rows instead of the previous one as well

'fieldIn.text = “1234567”

'fieldIn.value = “1234567”

Call fieldsIn.Append(“out1”, LCTYPE_TEXT)

Call fieldsIn.Append(“out2”, LCTYPE_TEXT)

Print “Calling the stored procedure…”

If (src.Call(fieldsIn, 1, fieldsOut) = 0) Then

Print “Stored Procedure called successfully.”

Set fieldOut1 = fieldsOut.GetField(1)

Set fieldOut2 = fieldsOut.GetField(2)

Call src.Fetch(fieldsOut)

Print "The retrieved Name is: " & fieldOut1.value

Print "The retrieved timestamp is: " & fieldOut2.value

Else

Print “There was an error running the Stored Procedure”

End If

src.Disconnect

Subject: HTTP JVM: java.lang.UnsatisfiedLinkError: Can’t find library ocijdbc9 (ocijdbc9.dll) in java.library.path.

Well, today I made it work in the following way:

  1. I rewrote Java program to use “thin” driver instead of “oci8” one.

  2. After I run it, the following error was thrown: “java.sql.SQLException: Io exception: SO Exception was generated”.

  3. After some investigation I found that the problem in JDBC connection string, which was

DriverManager.getConnection(“jdbc:oracle:thin:@odbc_system_name”, “user”, “password”);

and “thin” driver was unable to translate “odbc_system_name” to the “server:port:service” as

“oci8” did before (in Domino 5). So I rewrote it like this:

DriverManager.getConnection(“jdbc:oracle:thin:@server:port:service”, “user”, “password”);

and it worked.

  1. Then I tried to do the same in Lotus Java agent and it crashed the server, exactly like “oci8”

driver usage did with ocijdbc9.dll driver under Domino folder.

  1. Finally I wrote an LS2J agent that calls Java program to establish connection and to call stored

procedure and it worked.

Good luck,

Y.M.

Subject: RE: HTTP JVM: java.lang.UnsatisfiedLinkError: Can’t find library ocijdbc9 (ocijdbc9.dll) in java.library.path.

Now it’s final - it works in pure Java agent too. :slight_smile:

The server crashes weren’t caused by connection to the Oracle, but the following three rows:

String dbname = profdoc.getItemValueString(“dbname”);

if (dbname == “”) { return; }

Database db = session.getDatabase(server, dbname);

Row 2 has a bug - dbname should be tested for null istead of “” (which should be dbname.equals(“”) anyway), but it wasn’t, so when it was set to null in row 1, it was crashing the server in row 3. I am not sure this what getDatabase method should do when there is null instead of second parameter, but this is what it did. Every single agent run. Like a knockdawn.

Good luck,

Y.M.