2 Replies Latest reply: Jun 6, 2011 10:30 PM by 846238 RSS

    "JNI : Linux java.lang.UnsatisfiedLinkError

      Hi All,

      My bundles use JNI to communicate to the native code.

      My native code further uses Sqlite3 libraries.

      Please let me know how to link the the libraries:

      Command I have used to generate the JNI shared library:


      gcc -I/java/jdk/include -I/java/jdk/include/genunix -c DbOperations.c -o DbOperations.o

      ld -shared -f /usr/lib/libuuid.so DbOperations.o -o DbNativeInterface.so


      gcc -o libDbNativeInterface.so -shared -Wl,-soname,DbNativeInterface.so

      -I /usr/lib/jvm/java-6-sun-

      -I /usr/lib/jvm/java-6-sun- -I /<My path to>/SQLite/inc/ DbOperation.c

      Using this so file in the bundle throws following error:

      Couldn't start bundle: DataAccess (#22) (due to: java.lang.UnsatisfiedLinkError:


      /home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so: undefined symbol: sqlite3_open)

      java.lang.UnsatisfiedLinkError: /home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so:

      /home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so: undefined symbol: sqlite3_open

      Please guide with solutions or suggestions if any

      Thank you