Login  Register

Re: OSGi with Bndtools and Apache Felix throws exception

Posted by Wade Walker on Mar 25, 2013; 5:03pm
URL: https://forum.jogamp.org/OSGi-with-Bndtools-and-Apache-Felix-throws-exception-tp4028765p4028804.html

Here's what my resolver does:

unresolved: bundleresource://28.fwk1822163802/com/jogamp/common/os/Platform.class
resolved: jar:file:/D:/Users/Wade/Documents/Blog/jogl2/com.jogamp.jogl/gluegen-rt.jar!/com/jogamp/common/os/Platform.class
unresolved: bundleresource://28.fwk1822163802:1/jogamp/nativewindow/NWJNILibLoader.class
resolved: jar:file:/D:/Users/Wade/Documents/Blog/jogl2/com.jogamp.jogl/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class

So I'm not sure yours is correct -- it should be doing something like this:

unresolved: bundle://3.0:1/com/jogamp/common/os/Platform.class
resolved: jar:file:/C:/actual/path/to/file/gluegen-rt.jar!/com/jogamp/common/os/Platform.class
unresolved: bundle://3.0:2/jogamp/nativewindow/NWJNILibLoader.class
resolved: jar:file:/C:/actual/path/to/file/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class

JOGL uses the java.net.URL class to open the JAR file, then unpack its contents (the DLLs) into a temporary directory somewhere, so it needs to be able to find the JAR file with an absolute path on your file system. The URL class doesn't recognize the bundle: protocol (that's something OSGi has a custom classloader for), hence the need for a resolver.

You might also try running my name.wadewalker.OneTriangle project (which requires my com.jogamp.jogl project), just to make sure that JOGL works on your system and there's not some other odd problem going on.