Unsatisfied Link Error ....

Hi,

I am having a problem registering a java class using the CAS-COM Bridge gentypelib tool.

The java class I am trying to register uses native code in the form of dll's.

When I try to register the class I get the following error below.

I have looked up the exception and it says that the JVM cannot find a native-language defination of a method declared as native.

My question is, is there anyway I can put these dll's into the java.lib.path so that I can register this class ?

thanks for any help.

Paul

==========================================

E:\gmsAPI4.2\com\stc\eIndex\jni>gentypelib -javaclass com.stc.eIndex.jni.EiSession

java.lang.UnsatisfiedLinkError: no EiSession in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)

at java.lang.Runtime.loadLibrary0(Runtime.java:749)

at java.lang.System.loadLibrary(System.java:820)

at com.stc.eIndex.jni.EiSession.<clinit>(EiSession.java:33)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:120)

at com.sun.interop.typelib.Packager.loadBean(Packager.java:368)

at com.sun.interop.typelib.Packager.isValidStubInfo(Packager.java:139)

at com.sun.interop.typelib.Packager.<init>(Packager.java:109)

at com.sun.interop.typelib.Packager.main(Packager.java:79)

at java.lang.reflect.Method.invoke(Native Method)

at com.sun.interop.beans.PrivilegedMethodInvokeAction.run(PrivilegedMethodInvokeAction.java:51)

at java.security.AccessController.doPrivileged(Native Method)

at com.sun.interop.beans.RegularDispatcher.invoke(RegularDispatcher.java:142)

at com.sun.interop.dispatch.StaticsProxy.Invoke(StaticsProxy.java:96)

Cannot introspect on the specified JavaBean component com.stc.eIndex.jni.EiSession

com.stc.eIndex.jni.EiSession cannot be loaded from null

[1955 byte] By [knoxor] at [2007-9-26 5:57:38]
# 1

Hi,

The directory, where your dlls are, should be in the java load library path. This is merely an environment setting.

Try after putting the directory name in your "path" environment variable as well as "classpath" environment variable.

As far as I know, if the dll is in your "path", it is sufficient for the JVM to locate that dll. And similarly, this should be valid for your tool too.

Hope this helps

Vijay

avijay at 2007-7-1 14:32:12 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Hi Vijay,I should have mentioned that I have included the proper directory in the PATH env variable and also put the dll's into the windows\system directory to be on the safe side.This still does not work. Thanks for your help anyway.Paul
knoxor at 2007-7-1 14:32:12 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
Couple of ways...You can do System.getProperties().put("java.library.path", "yourpath")inside your session... or...Try copying your dll into the JDK bin directory. It should work.
kumararajan at 2007-7-1 14:32:12 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

Hello:

I am having a similar problem and was in need of some assistance.

I have written a test java program that loads in a dll and calls a function from the dll, lets say the function name is foo, I have compiled the native code into a dll file using g++3.0, note that this native code in turn loads in another dll and calls a function from that dll. When I go to execute my java code I get an unsatified link error with the function foo. I am using Windows 2000 and jdk 1.4.1, listed below are the things that I have already tried:

1) I have put the dll file location in my PATH environment variable

2) I have used the LoadLibrary function inside my C code to also load the other two dll files that foo.dll depends on, I got the list of dependencies by running the microsoft dumpbin utility

I would really appreciate any help on this matter

Thanks Again

kanjilal4 at 2007-7-1 14:32:12 > top of Java-index,Java HotSpot Virtual Machine,Specifications...