Posted by
Oscar Vargas Torres on
May 09, 2013; 1:59am
URL: https://forum.jogamp.org/JOGL-with-OSGi-tp3773888p4029116.html
I am using jogl with Apache Karaf. However, I cannot make Karaf to recognize libgluegen-rt.jnilib. I've spent last two days trying several approaches without success.
One of the approaches I tried was to deploy jogl-all-main, gluegen-rt-main and all of their dependants in the hot deploy directory. The errors are here:
http://pastie.org/pastes/7814616I was suggested to make a gigantic bundle with all the native jars and java-only jars. I tried that too, but then karaf complains doesn't start the bundle and when I try to start it, I get an error message that it cannot find native libraries.
I tried to bundle the jars with native libraries (on Mac OS X, they are distributed as jnilib files):
$ cat propNative.bnd
-classpath: gluegen-rt-2.0-rc11-natives-macosx-universal.jar, jogl-all-2.0-rc11-natives-macosx-universal.jar
Bundle-SymbolicName: jogl-gluegen-macosx
ver: 2.0-rc11
-output: ${bsn}-${ver}.jar
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Bundle-NativeCode: libgluegen-rt.jnilib ; libnativewindow_macosx.jnilib ; libjogl_desktop.jnilib ; libjogl_mobile.jnilib ; libnativewindow_awt.jnilib ; libnewt.jnilib ;
osname=MacOS ; processor=x86-64 , *
# Uncomment next line to customise imports. The last entry MUST be "*"
# Import-Package: *
### By the way, mybnd is just an alias for java -jar /path/to/bnd.jar; bndlib.jar is in my classpath
oscars-imac:macosxBundle oscarvarto$ mybnd propNative.bnd
-----------------
Warnings
000: propNative.bnd: The JAR is empty: The instructions for the JAR named jogl-gluegen-macosx did not cause any content to be included, this is likely wrong
So maybe my problem is that I don't know how to embed jnilibs in an osgi bundle???
I see your comment:
The trick I use is creating a project/bundle for JOGL that contains the gluegen and JOGL JARs, then creating fragment projects/bundles for each of the native platforms. At runtime, OSGi loads the correct fragment for the platform.
but I guess I don't know how to what you suggest (little experience with osgi).
Please I need help! I've been trying for a lot of time without success.