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

RMI vs JNI problem

wip siva
Ranch Hand

Joined: Nov 03, 2000
Posts: 36
hi friends.
i am calling a simple c function from java.i created a .so file
from some othere m/c.and i copied all necessary files.while
starting the rmi registry.its trying to load the library.i am getting the follwoing exceptions.
plz let me know the problem.
thanx in advance
Exception in thread "main" java.lang.UnsatisfiedLinkError: no my_lib in java.lib
rary.path
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Error.<init>(Error.java:50)
at java.lang.LinkageError.<init>(LinkageError.java:43)
at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:42)
at java.lang.ClassLoader.loadLibrary(Compiled Code)
at java.lang.Runtime.loadLibrary0(Runtime.java:470)
at java.lang.System.loadLibrary(System.java:778)
at <Unloaded Method>
at com.wipro.osssmart.config.MainServer.main(MainServer.java:39)
$
Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
Well,
First of all check your LD_LIBRARY_PATH.
The naming convention on UNIX is lib(libraryname).so so make sure that your library is named correctly.
Also do ldd -r libmy_lib.so. This would tell you if you have unsatisfied links within the library
wip siva
Ranch Hand

Joined: Nov 03, 2000
Posts: 36
hi friend
thanx for ur reply.
i have set LD_LIBRARY_PATH also.i am working on solaris.
now its not giving this problem while starting the rmiregistry.
now its giving while calling the native function from my GUI.
like java.rmi.server error
and unsatisfiedlinkerror
plz help me in this.
i am in a critical situation
thanx
wip siva
Ranch Hand

Joined: Nov 03, 2000
Posts: 36
hi friend
i did ldd -r libGetBackup.so
its giving like this
warning: ldd: libGetBackup.so: is not executable
symbol not found: printf (./libGetBackup.so)
symbol not found: system (./libGetBackup.so)
wheather the .so file should be in executable mode or what
this is from solaris m/c
plz let me know
thanx
 
jQuery in Action, 2nd edition
 
subject: RMI vs JNI problem