OSGi: need J3D 1.6 source code for a patch

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

Re: OSGi: need J3D 1.6 source code for a patch

gouessej
Administrator
Java3D 1.6 cannot work without JOGL. If it is possible to work around the problem of initialization directly in JOGL, you won't have to modify Java3D to make an OSGI bundle from it.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

JeanPhi
This post was updated on .
The problem is that J3D fails to run with bundles due to static initialization (and OSGi class loading). Fails means that without a patching J3D or using a dirty workaround it is not possible - as JVM prevents loading twice the same native lib - to run J3D in an OSGi project.

Now, as you answered my initial question and that I have the source code, I can patch myself :)

I'm not to sure to be clear enough :S
Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

Sven Gothel
Administrator
On 11/08/2013 02:33 PM, JeanPhi [via jogamp] wrote:
> Well, JOGL is not a problem in itself. Making a bundle from several jars can
> be done without great difficulty.
>
> The problem is that J3D fails to run with bundles due to static initialization
> (and OSGi class loading). Fails means that without a patching J3D or using a
> dirty workaround it is not possible - as JVM prevents loading twice the same
> native lib - to run J3D in an OSGi project.

JogAmp loads native JARs per JVM and classloader as required
if using the native JAR libloading process as provided via GlueGen's runtime.

'Our' Java3D should use this mechanism .. and cause no problems IMHO.

~Sven


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

Re: OSGi: need J3D 1.6 source code for a patch

gouessej
Administrator
Sven Gothel wrote
'Our' Java3D should use this mechanism .. and cause no problems IMHO.
This is a good piece of news but I don't know how to modify Java3D initialization to use the same mechanism. Your solution seems to be smarter.

Edit.: JeanPhi, I remind you that Java3D 1.6 doesn't need any native libraries except those of JOGL and GlueGen (it wasn't the case in Java3D 1.5.2).
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

JeanPhi
What is strange is that J3D does not seem to use JOGL. The only thing I found is that it tries to load libj3dcore-ogl.so and fails if already loaded. I don't have a clue what this lib uses... maybe opengl directly?

PS: are you sure J3D uses JOGL?
Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

hharrison
I think you are using an old version of Java3D, likely 1.5.2.

The version of Java3d I maintain has removed all native libraries.  If you see something loading libj3dcore-ogl.so then you are not using the version of Java3d from jogamp.

Source code for my version is located here:

https://github.com/hharrison/vecmath
https://github.com/hharrison/java3d-core
https://github.com/hharrison/java3d-utils

Prebuilt jars avaiable here:

http://jogamp.org/deployment/java3d/1.6.0-pre8/

This version of Java3d relies _completely_ on jogl2 to get access to OpenGL.

Harvey

Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

gouessej
Administrator
In reply to this post by JeanPhi
JeanPhi, I'm sure Java3D 1.6 uses JOGL as I'm the guy who initiated its port to JOGL 2. Harvey is right; if you don't use JOGL, you still use Java3D 1.5.2. Have you ever read that?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

JeanPhi
Hi all, I had time to go back to J3D :)

Here are my findings:
 * Yes you are right, I did patch 1.5.2 instead of 1.6.0
 * 1.6.0 does still not contain OSGi manifest headers, but...
 * 1.6.0 now works without the code modification I mentioned (which was mandatory for 1.5.2)!

There are few things to do to make J3D a bundle. The simplest way is to create a single jar file (a kind of meta project) containing j3dcore.jar, j3dutils.jar and vecmath.jar, as well as all native resources. Then add a proper manifest to this archive.

The manifest must expose imported/exported packages, specify a bundle-classpath pointing to j3dcore/j3dutils/vecmath and the bundle-nativecode describing the different native libraries plus the OS/processor they are related to.

PS: tests made with pre1-1011070159
PS2: I did also make JOGL a bundle

JP
Reply | Threaded
Open this post in threaded view
|

Re: OSGi: need J3D 1.6 source code for a patch

hharrison
Java3d 1.6.0 has no native code, all that stuff is in the Jogl2 project, so this should be pretty easy to produce manifests
for....patches welcome!!

Alternatively, if you send me a (tested) example of what the manifest should look like for each project, I will get it
wired into the build.

(Wanna be the OSGi maintainer?)

Harvey
12