JOGL incompatible with X Display :0.1 (JDK 6 u 11 on amd64)?

Good Morning Everyone,

I just upgraded to JDK 1.6.0 update 11 (which fixes the bug that always causes it to display on X display :0.0, even though the java instance may have been lauched on X server :0.1).

When a JOGL-compliant application (such as NASA worldwind, http://worldwind.arc.nasa.gov/java/index.html) is launched on display :0.0, it launches and displays its graphics correctly. However, when it is launched on display :0.1, it fails, and displays the following exception:

$ ./run-demo.bash gov.nasa.worldwind.examples.ApplicationTemplate
Running gov.nasa.worldwind.examples.ApplicationTemplate
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.<init>(GLCanvas.java:142)
        at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90)
        at gov.nasa.worldwind.awt.WorldWindowGLCanvas.<init>(Unknown Source)
        at gov.nasa.worldwind.examples.ApplicationTemplate$AppPanel.<init>(Unknown Source)
        at gov.nasa.worldwind.examples.ApplicationTemplate$AppFrame.initialize(Unknown Source)
        at gov.nasa.worldwind.examples.ApplicationTemplate$AppFrame.<init>(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at gov.nasa.worldwind.examples.ApplicationTemplate.start(Unknown Source)
        at gov.nasa.worldwind.examples.ApplicationTemplate.main(Unknown Source)

I’m running on 64-bit linux (uname -a: 2.6.18-92.1.18.el5 #1 SMP Wed Nov 5 09:00:19 EST 2008 x86_64 x86_64 x86_64 GNU/Linux) and the latest release amd64 java:

$ java -version:
  java version "1.6.0_11"
  Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
  Java HotSpot(TM) 64-Bit Server VM (build 11.0-b16, mixed mode)

Display :0.0 is an Nvidia Quadro NVS 290 on :0.0 and Nvidia Geforce 8800 GT on :0.1. The nVidia driver is:
NVIDIA dlloader X Driver 177.82 Tue Nov 4 16:56:15 PST 2008 for linux/amd64. glxgears on :0.0 displays 1989.814 FPS and on :0.1 displays 12777.067 FPS).

Does anyone have any suggesstions? Is jogl incompatible with higher X displays than :0.0?

Thank you in advance for any help :slight_smile:

Tim

Hi Tim

I’ll report my last suggestion here, as it is not related to Java3D .

That error happens because JOGL fails to get a valid GraphicsConfiguration from Frame.

As you are using Gears demo , you can try to change it to looks like below.

If it fails, open a Issue. It is bug.


      
Regards, 
ZeSharp


 public static void main(String[] args) { 
     
    frame = new Frame("Gear Demo"); 
    
    // create 3D stuff later 
    SwingUtilities.invokeLater(new Runnable(){
        public void run(){
            createCanvas();
        }
    });
  }
 // The Frame
  private static Frame frame = new Frame("Gear Demo");
  
 // to be launched later, when container  Frame is alive new screen
  private static void createCanvas(){
    GLCapabilities caps = new GLCapabilities();
    caps.setAlphaBits(8); 
    caps.setRedBits(8); caps.setGreenBits(8); caps.setBlueBits(8);
    caps.setDepthBits(24);
    GLCapabilitiesChooser chooser = new DefaultGLCapabilitiesChooser();
    GLContext context = GLContext.getCurrent();
    GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
   
    System.out.println("Device String : " + device);
    System.out.println("Graphics config : " + device.getDefaultConfiguration());
    
    GLCanvas canvas = new GLCanvas(caps, chooser, context, device);
   
    canvas.addGLEventListener(new JOGLGearsDemo());
    frame.add(canvas);
    frame.setSize(300, 300);
    final Animator animator = new Animator(canvas);
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          // Run this on another thread than the AWT event queue to
          // make sure the call to Animator.stop() completes before
          // exiting
          new Thread(new Runnable() {
              public void run() {
                animator.stop();
                System.exit(0);
              }
            }).start();
        }
      });
    frame.show();
    animator.start();
  }