NCDF problem with VirtualUniverse

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

NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org

Thank you to all contributors for reviving Java3d and sustaining JOGL.  I'm trying Java3d 1.6.0 and JOGL 2.0 on Oracle JDK 1.7 on Mac OS X 10.8.2.  I see this exception as my app tries to start up:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class javax.media.j3d.VirtualUniverse
        at javax.media.j3d.GroupRetained.<init>(GroupRetained.java:155)
        at javax.media.j3d.BranchGroupRetained.<init>(BranchGroupRetained.java:50)
        at javax.media.j3d.BranchGroup.createRetained(BranchGroup.java:71)
        at javax.media.j3d.SceneGraphObject.<init>(SceneGraphObject.java:114)
        at javax.media.j3d.Node.<init>(Node.java:172)
        at javax.media.j3d.Group.<init>(Group.java:549)
        at javax.media.j3d.BranchGroup.<init>(BranchGroup.java:63)
        at org.vorthmann.zome.render.java3d.Java3dSceneGraph.<init>(Java3dSceneGraph.java:146)

Can anyone provide insight?

This is using jogl-all-noawt.  With jogl-all-awt, I saw no exception at all, and what looked like a blocked thread, since my splash screen stayed up indefinitely.  Which alternative is appropriate for use with Java3d?

Thank you,

Scott
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

gouessej
Administrator
Hi

I wrote in my tutorial that Java3D is composed of 3 JARs, it doesn't work if you only use j3dcore.jar. Please try to follow my instructions:
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/#installation

Edit.: There are still some freezing problems under Mac OS X 10.8.2, I don't know when it will be fixed.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
Yes, I have all three.  I've been using Java Web Start with Java3d for 7-8 years, and I hope to continue.  Your installation instructions are not that useful to me in this context, I'm afraid.

Thanks for the pointer.  It indicated a possible problem with one of the JARs w.r.t. my JNLP file or my JAR signing.  However, I've double-checked all of that, and replaced the JARs with new signed copies, but still no luck.

I get the same problem whether I use Oracle's JDK 1.6 or Apple's JDK 1.6.

Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
I note that VirtualUniverse.class is in the j3dcore.jar with all the other classes showing on my stacktrace.  I also looked that the source for VirtualUniverse.java, and it appears to have no imports outside of the JRE.  What exactly can be causing this NCDF?
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
Never mind.  I see that there is a static block that does the loadLibraries.  My JNLP files must not be giving me what I need for JOGL.
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

gouessej
Administrator
Java3D has evolved a lot in this latest pre release, it cannot be deployed the same way than before but it is easier to use now. Maybe the native libraries can't be loaded. Have you forgotten those used by JOGL 2.0 (they are in several JARs)?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
I'm using the JOGL 2.0 extension JNLP file provided by jogamp.  I've tried both awt and noawt forms.  The JNLP file seems to work  nicely for the JOGL demos.

I turned on FINEST logging for j3d.core, but there's nothing logged about the library failure:

Nov 18, 2012 3:35:35 PM javax.media.j3d.VirtualUniverse <clinit>
CONFIG: 3D [dev] 1.6.0-pre3-daily-experimental daily
Nov 18, 2012 3:35:36 PM javax.media.j3d.VirtualUniverse <clinit>
CONFIG: Initializing 3D runtime system:
    version = 1.6.0-pre3-daily-experimental daily
    vendor =
    specification.version = 1.6
    specification.vendor =

Here is the relevant portion of my JNLP file for Java3d, FWIW:

<resources>
    <jar href="/jnlp/media/java3d/1.6.0/j3dcore.jar" download="eager" main="false"/>
    <jar href="/jnlp/media/java3d/1.6.0/j3dutils.jar" download="eager" main="false"/>
    <jar href="/jnlp/media/java3d/1.6.0/vecmath.jar" download="eager" main="false"/>
    <property name="sun.java2d.noddraw" value="true"/>
    <extension href="http://jogamp.org/deployment/archive/rc/v2.0-rc11/jogl-all-noawt.jnlp" name="jogl-all-noawt"/>
  </resources>
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
Does anyone know of a way to get more logging from the native library loading?  It is hard to work blind, with pure guesswork.
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

gouessej
Administrator
In reply to this post by scott+jogamp@vorthmann.org
You cannot use Java3D with noawt because Java3D uses the AWT GLCanvas of JOGL 2.0.

Edit.: Do you use JOAL too? I had a problem with JOAL a few weeks ago during initialization, it just got frozen. I had to initialize it in a static initializer.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
No, I don't use JOAL.

The switch from noawt to awt helped, thank you.  No more exception, and I get a bunch of FINEST logging coming from MasterControl:

Nov 18, 2012 8:59:59 PM javax.media.j3d.MasterControl dumpMessage
FINEST: sendMessage LIGHT_CHANGED  threads: UPDATE_RENDERING_ENVIRONMENT
Nov 18, 2012 8:59:59 PM javax.media.j3d.MasterControl dumpMessage
FINEST: sendMessage LIGHT_CHANGED  threads: UPDATE_RENDERING_ENVIRONMENT
Nov 18, 2012 8:59:59 PM javax.media.j3d.MasterControl dumpMessage
FINEST: sendMessage LIGHT_CHANGED  threads: UPDATE_RENDERING_ENVIRONMENT
... etc

However, there seems to be a thread blocked.  My splash screen stays up, and I never get my main window coming up.  Looks like Java3d is not returning control.
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
I can run JConsole, and it shows a number of threads waiting, but I don't see how to get it to make a thread dump.
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

hharrison
If you can get jvisualvm working instead, I'd be very interested in the thread dumps in your case
to see what threads are actually locking.  If you're comfortable with jconsole, jstack is the tool to dump
out stack traces.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

scott+jogamp@vorthmann.org
Here it is, Harvey.  I hope the upload works.

threadDump.txt
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

hharrison
The upload worked, it looks like a deadlock between the Java3d renderer thread (trying to call getMaxFixedFunction) and the AWT Event thread which is doing some work trying to get the best configuration....pretty sure that's the QueryCanvas internally in JOGLPipeline.  Pretty much what I expected,
but maybe others have a different idea.


Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

gouessej
Administrator
I think you're right, QueryCanvas is a mess. Do you have an idea to remove it completely? Do you think it is possible?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

hharrison
I think it can get killed completely, it is just so twisted up with the Canvas3D's lifetime that it is a bit tricky
to get right.  Any and all help welcome :-(

Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

gouessej
Administrator
I have to fix a last bug in JMonkeyEngine 3. Then, maybe I can spend several hours to fix it once for all.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

InteractiveMesh
In reply to this post by hharrison
The thread on which GraphicsConfigTemplate3D.getBestConfiguration() is called will be blocked until the Renderer instance will release it after finding the best configuration via JoglPipeline methods on the J3D-Renderer-x thread.

JoglPipeline.getBestConfiguration() calls JoglPipeline.getDefaultProfile() which calls GLProfile.getMaxFixedFunc(true) where in the deep JAWTUtil's static initializer calls EventQueue.invokeAndWait() if not invoked on the EDT.

So, if GraphicsConfigTemplate3D.getBestConfiguration() is called on the EDT (most likely in this case) a deadlock will arise because EventQueue.invokeAndWait() will never return. I can reproduce this behavior.  

Short term work-around: Don't create a GraphicsConfiguration instance for Canvas3D by using a GraphicsConfigTemplate3D or calling SimpleUniverse. getPreferredConfiguration() on the EDT.

I suggest to introduce a member 'glProfile' instead of calling 'getDefaultProfile()' several times:  

    private GLProfile glProfile = null;

    /** Constructor for singleton JoglPipeline instance */
    protected JoglPipeline() {
        glProfile = GLProfile.getMaxFixedFunc(true);
    }

August
Reply | Threaded
Open this post in threaded view
|

Re: NCDF problem with VirtualUniverse

gouessej
Administrator
Thank you very much. The profile should be obtained and stored once for all.
Julien Gouesse | Personal blog | Website