Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.lang.UnsatisfiedLinkError

Reply
Thread Tools

java.lang.UnsatisfiedLinkError

 
 
ba.hons
Guest
Posts: n/a
 
      09-18-2006
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

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      09-18-2006
On 18 Sep 2006 12:33:38 -0700, ba.hons wrote:
> 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

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
 
ba.hons
Guest
Posts: n/a
 
      09-18-2006
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

 
Reply With Quote
 
debapriya.patra debapriya.patra is offline
Junior Member
Join Date: Mar 2009
Posts: 3
 
      03-18-2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments