I have been reporting problems with JNI/Invocation
with JDK 1.1.7v1a+native for apps that use libdl.so,
a bug which has been confirmed by Blackdown.

By accident I discovered a quick patch on this problem
that seems to work fine on my Debian "slink" snapshot, 
so if you happen to be stuck with a similar problem, 
give it a try.


 #!/bin/sh
 # Preload JVM DLL, call app next.
 # The app in question is linked against libdl.so,
 #  but not linked against libjava.so. It does
 #  use dlopen("libJ.so"), and libJ.so is linked
 #  against libjava.so. libJ.so does invocation 
 #  of a JVM, app is not Java aware.
 # Without the preload, this fails 
 #  on every RH 5.x and Debian 2.x I tried so far.
 LD_PRELOAD="libjava.so" app


The funny thing is that I tried this rather by
accident. Rumor had it that the problem was due
to the order in which symbols are resolved, and
this makes sure that libjava.so gets resolved
first. See "man 8 ld.so":

 LD_PRELOAD
   A  whitespace-separated  list  of additional, user-
   specified, ELF shared libraries to be loaded before
   all  others.  This can be used to selectively over­
   ride functions in other shared libraries.

Who knows, maybe this works under other circumstances,
for other problems, too.

                                    b.

Reply via email to