linking JNI wrapper so library to another sol library (not static)
843829Jan 6 2005 — edited Jan 6 2005The general topic is creating a wrapper c shared-object library to invoke functions in an existing shared-object (dynamically linked to) library in unix (aix and linux).
All the examples I've seen online involve creating a shared-object library (dynamic linking) for the wrapper native library which in turn invoke library routines in a statically linked existing library. Also most of them are for *.dll libraries which I'm not familiar with.
The error I'm getting is:
The java class could not be loaded. java.lang.UnsatisfiedLinkError: /bob/libso/libJniWrapper.so: load ENOEXEC on shared library(s) /bob/libso/libExistingSharedObjectLibrary.so
where /bob/libso is found by the class loader.
I'm looking at a lot of things including symbols not being imported/exported, too many symbols (java -verbose:jni generated messages like "ALERT: JNI local ref creation exceeded capacity (creating: 17 limit: 16 ..." ) but it's beginning to occur to me that the problem is that the vm needs to bring in all the object code of the ultimate shared-object library. Fine for statically linked in libraries, not so fine for dynamically linked in existing libraries.
Has anyone created wrapper native libraries that invoke functions in lib*.so libraries. Any suggestions?