The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

gouessej
Administrator
This post was updated on .
Hi

I tried to use the automatic extraction and loading of native libraries from JARs in an application based on Eclipse RCP that use several fragments for JOGL, it worked fine with several fragments for native libraries but not with a single fragment with all JARs including those containing the native libraries.

@Wade Walker I assume you know why, don't you?

@Sven Could we find a solution to fix that or do we have to live with it as is?

Edit.: I get an UnsatisfiedLinkError for gluegen-rt.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

Sven Gothel
Administrator
On 07/11/2012 10:12 AM, gouessej [via jogamp] wrote:

> Hi
>
> I tried to use the automatic extraction and loading of native libraries from
> JARs in an application based on Eclipse RCP that use several fragments for
> JOGL, it worked fine with several fragments for native libraries but not with
> a single fragment with all JARs including those containing the native libraries.
>
> @Wade Walker I assume you know why, don't you?
>
> @Sven Could we find a solution to fix that or do we have to live with it as is?
I validated a few scenarious w/ Eclipse, see:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=522>

Can you elaborate about the details a bit ?
Maybe a test project ?

~Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

gouessej
Administrator
My problem is not the same.

We currently put JOGL & GlueGen class JARs into a fragment called "JoglLib", we put native libraries into disctinct fragments called "JoglLib.linux32", "JoglLib.linux64", "JoglLib.win32" and "JoglLib.win64". It works fine.

When I try to use only JARs (those containing class files and those containing native libraries) and to put them all into "JoglLib", I get an UnsatisfiedLinkError. In my humble opinion, it is caused by Eclipse RCP itself which is not designed to use native libraries this way.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

Sven Gothel
Administrator
On 07/11/2012 12:36 PM, gouessej [via jogamp] wrote:

> My problem is not the same.
>
> We currently put JOGL & GlueGen class JARs into a fragment called "JoglLib",
> we put native libraries into disctinct fragments called "JoglLib.linux32",
> "JoglLib.linux64", "JoglLib.win32" and "JoglLib.win64". It works fine.
>
> When I try to use only JARs (those containing class files and those containing
> native libraries) and to put them all into "JoglLib", I get an
> UnsatisfiedLinkError. In my humble opinion, it is caused by Eclipse RCP itself
> which is not designed to use native libraries this way.
Me using Eclipse Juno 4.2.0.
My setup here using the one jogamp-lib approach w/o a native library path,
hence utilizing the native Jar lib loading. No need to distinct the platform.
I was able to debugged a unit test here a few days ago.

Maven was working as well, using the m2e plugin, w/o any setup.
I was testing the maven/jogl demo as linked in our Wiki by Mark.

Dunno what 'fragment' is .. I assume some OSGi bundle thingy?
If so - indeed .. this probably needs more love.

Sorry for my lack of comprehension.

~Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

Wade Walker
Administrator
In reply to this post by gouessej
gouessej wrote
@Wade Walker I assume you know why, don't you?
Is the problem even when running your RCP app from within Eclipse, or is it only in a deployed RCP application? Let me know which, and I'll try it out to double-check.
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

gouessej
Administrator
It happens even when running our RCP application from within Eclipse 3.7.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

Jarek Przygódzki
Automatic extraction and loading is only used when initialization logic in com.jogamp.common.os.Platform{...}.static { } is able to recognize platform JAR file URL . Equinox uses bundleresource protocol which is not recognized  (there's swallowed IllegalArgumentException involved)
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

Wade Walker
Administrator
This problem was reported in https://jogamp.org/bugzilla/show_bug.cgi?format=multiple&id=687, and should be fixed in the current version of JOGL. There are some examples of how to use the fix in the thread at http://forum.jogamp.org/JOGL-with-OSGi-td3773888.html. Essentially you give JOGL a custom URL resolver to handle the bundleresource case.
aqd
Reply | Threaded
Open this post in threaded view
|

Re: The automatic extraction and loading of native libraries from JARs do not work in applications based on Eclipse RCP and multiple fragments

aqd
In reply to this post by gouessej
You have to extract them from JARs and put into JAR/directory of the plugin where jogl.jar is included:

plugin-dir\
    os\
        win32\
            x86_64\
                gluegen-rt.dll
                jogl_desktop.dll
                jogl_mobile.dll
                nativewindow_awt.dll
                ......