aspose file tools*
The moose likes Beginning Java and the fly likes UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "UnsatisfiedLinkError" Watch "UnsatisfiedLinkError" New topic
Author

UnsatisfiedLinkError

Michael Scott
Ranch Hand

Joined: Jan 20, 2003
Posts: 57
I have Java code that generates the following error:

HTTP JVM: [Signaling in VM: java/lang/UnsatisfiedLinkError, message: /opt/lotus/notes/65040/ibmpow/libXfoJavaCtl.so: load ENOENT on shared library(s)]


The code is as follows. It fails on the line: axfo = new XfoObj();

import lotus.domino.*;
import java.io.*;
import java.util.*;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import jp.co.antenna.XfoJavaCtl.*;

public class JavaAgent extends AgentBase {
public void NotesMain() {
XfoObj axfo = null;
try {
Session session = getSession();
System.out.println("About to create an instance of \"XfoObj\" class . . .");
axfo = new XfoObj();
System.out.println("Created an instance of \"XfoObj\" class . . .");
} catch (Throwable th) {
th.printStackTrace();
} finally {
if (axfo != null) {
try {
axfo.releaseObjectEx();
System.out.println("\"XfoObj\" instance released . . .");
} catch (Throwable th) {
th.printStackTrace();
}
axfo = null;
}
System.runFinalization();
System.gc();
}
}
}

I'd appreciate any suggestions on how to resolve this error.


Additional details:

The file 'libXfoJavaCtl.so' comes with third party software (Antenna House) which is integrated with a Domino application. I tried copying this file
from its original location in the Antenna House 'lib' directory
to the directory '/opt/lotus/notes/65040/ibmpow'. However, the Java code still does not run to completion.

Thanks.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14108
    
  16

The error means that the native library cannot be found. You say you moved it to the lib directory. Did you also set the PATH or LD_LIBRARY_PATH or whatever it's called on your operating system so that it includes the lib directory?

Instead of setting the platform-specific environment variable, you can also set the Java system variable java.library.path to point to the directory that contains the native library. You do that by adding an extra parameter to the command line:

java -Djava.library.path=path to lib dir mypackage.MyClass
[ August 26, 2006: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnsatisfiedLinkError