chooseGraphicsConfiguration() not used ... on Linux

I’ve been developing JOGL apps on Windows and Fedora for ages and never run into this. Trying to run the JOGL demo “Gears” (or any that use a GLCanvas for that matter) I get

Exception in thread “main” java.lang.IllegalArgumentException: GLDrawableFactory.chooseGraphicsConfiguration() was not used when creating this Component
at com.sun.opengl.impl.x11.X11GLDrawableFactory.getGLDrawable(X11GLDrawableFactory.java:238)
at javax.media.opengl.GLCanvas.(GLCanvas.java:142)
at javax.media.opengl.GLCanvas.(GLCanvas.java:90)
at demos.gears.Gears.main(Gears.java:24)

This is straight out-of-the-box jogl-1.1.1-linux-i586 (JSR-231-1.1.1a (June 18) (15)) and corresponding jogl demo code. Running Ubuntu 9.04 and Eclipse 3.2.

I’ve found posts related to multi-head monitors and X11 (not case here). Also I saw the reference to X11 in the JavaDoc, but choosing GLGraphicsCapabilities etc. doesn’t help. Does someone please have an answer?

I’ve never seen this before when calling new GLCanvas() !

I love git … ‘git checkout 1.x-maint’ :slight_smile:

AWT Component’s comp.getGraphicsConfiguration() is null …

chooseGraphicsConfiguration() … is being called in GLCanvas
in the constructor, where an AWT GraphicsConfiguration is being set.

After that the getGLDrawable call happens …
Well, it worked a long time, now it doesn’t, puzzling.
Your peers seem no to be initialized hence GraphicsConfiguration is null.
It is guaranteed to be when addNotify is being called,
hence I changed this behavior in JOGL2 and do all of it at addNotify/removeNotify.

Looks like the initialization sequence of your running Java/AWT has changed.
Would you mind trying JOGL 2.x ?

Thx …

OK. Thanks. Jogl 2.0 works, but it really breaks my FengGUI code :frowning:

Is there a workaround to get 1.1.1 going? Please?

It is strange, I’m under Linux and I don’t reproduce your problem. I use Mandriva Linux 2007, JDK 1.6 update 11 and JOGL 1.1.1a.

That’s why I was after some debugging tips. I’ve never had this issue on Fedora, but do now on a shiny new install of Ubuntu 9.04 on unmodified JOGL. I just need to know where to start looking…nvidia, jre, X11…

OK it was the JRE. OpenJDK vs. Sun JRE (latter works).