java.lang.UnsatisfiedLinkError

B

ba.hons

Hello,

i am using some classes which were written to be executed by a web
service and am trying to use them in a test application which will use
a simple main method.

the class am trying to use has a

System.loadLibrary("thedll");

and then has a number of native methods which i asume are all stored
within "thedll"

each time i attempt to execute any the native methods i get:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
theMethodAmCalling

i have tried using dependencywalker application make sure i have all
the dependent dll's and from what i can see they are all stored in my
system32 directory, i have made sure my PATH variable has this
directory as well so it isnt that, and anyway it doesnt through an IO
error so it must actually find the dll.

ANY IDEAS would be really great

thanks in advance

ADAM
 
G

Gordon Beaton

each time i attempt to execute any the native methods i get:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
theMethodAmCalling

Just to confirm: you get no exception when you load the DLL, you get
the exception when you attempt to invoke one of the methods?

If that's the case, then the JVM is unable to find the methods it
expects to find in the DLL.

Note that the DLL was necessarily written to be used from a particular
Java class. That class declares a number of native methods, and the
DLL contains implementations of those methods. You cannot load the
same DLL from another class and expect to be able to use those methods
as though they belonged to the new class, because the method names in
the DLL are determined (in part) by the name of the class they belong
to.

Did you rename the class the dll was intended to be used from? Did you
change its package declaration?

If any of this is unclear to you, then post some real code (not just
an abstract example).

/gordon
 
B

ba.hons

YOUR A STAR !!!

i had changed the package name and that was causing the problem, really
thanks for the help i think i would have been here all night !!

Adam
 
Joined
Mar 18, 2009
Messages
3
Reaction score
0
Exception in thread "main" java.lang.UnsatisfiedLinkError: <method name>

Hi ,
I am facing problem when i am trying to call the native method from the dll.
Its loading the dll, but when i am calling the native method its throwing the error called ::

Exception in thread "main" java.lang.UnsatisfiedLinkError: display


This is my code where i am calling the native method::

package delfigo;

/**
* @author Debapriya.Patra
*
*/
public class JNIInvocation {
public native int display();

static {
System.loadLibrary("delfigo");
}

/**
* @param args
*/
public static void main(String[] args) {
// Call C++ method
JNIInvocation lInvocation = new JNIInvocation();
lInvocation.display();
}

}



can anybody help me on this...

thnx in advance..

Regard,
deba:-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top