Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.lang.UnsatisfiedLinkError

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi all!

I get this java exception: 'java.lang.UnsatisfiedLinkError, This object can only be invoked through an interface reference' when I try to access a method of a dll from my own dll. Any ideas? I don't understand because I can 'see' the methods of the dll, as they are defined as public. Is this a registry restriction? thanxs.

cheers,
alej
 
Are you using jni?
dlls aren't common java libraries.

So you need to load them first, and references are tested at runtime.

I guess we need more details.

And you use 2 dlls? A own one and a second one?
 
Thanxs for the help, I discovered what it was. In j++ when accesing a COM class you need to make an instance of the interface of the class and not of the class itself. It doesn't give any compile errors and with other dlls I had done it the wrong way but it worked. Don't really know why it was working before, but at least I got the proper way now.

cheers,
alej
 
So if you use j++, you should probably mention it on the Subject-line or at least in the text, because you know, j++ isn't java. It's c#-- ;)
 
Sorry for that, since I got the error message from the asp file where the dll is called I thought that it had nothing to do with j++. So then this 'must' of making an instance of the interface its just because I use j++?

cheers,
alej
 
Maybe you could reproduce this error with java, but it's not very common to load dll-files.
Without knowing more details: which dlls are involved, how are the classes defined, ... I can not answer this, I have zero experience in j++.

 
J++ is actually not C#. It is a lanuguage which has syntax similar to Java, but is compiled into the .NET MSIL for use in the runtime CLR. Which admittedly, is similar to C#, but not the same.
 
Well...anyway I got the way for the moment ;) thanxs to all

cheers,
alej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top