Linux: Error making context current

Hi there,

running a simpe JOGL test case on my up-to-date Debian-unstable box (ATI Radeon 9600 graphics card, standard xorg-ati driver) using the current 1.1.1-rc8, I get the following exception:


Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Error making context current
	at com.sun.opengl.impl.x11.X11GLContext.makeCurrentImpl(X11GLContext.java:141)
	at com.sun.opengl.impl.x11.X11OffscreenGLContext.makeCurrentImpl(X11OffscreenGLContext.java:74)
	at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
	at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
	at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:661)
	at javax.swing.JComponent.paint(JComponent.java:1027)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1036)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1036)
	at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
	at javax.swing.JComponent.paint(JComponent.java:1013)
	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
	at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
	at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
	at java.awt.Container.paint(Container.java:1797)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
	at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

The test app’s source code:


package test.jogl;

import java.awt.*;
import javax.swing.*;
import javax.media.opengl.*;

public class JOGLTest extends JFrame implements GLEventListener {
	
	public static void main(String[] argv) {
		JOGLTest j = new JOGLTest();
		j.setLocation(100, 100);
		j.setSize(640, 480);
		j.setLayout(new BorderLayout());
		
		GLCapabilities caps = new GLCapabilities();
		GLAutoDrawable canvas = new GLJPanel(caps);
		j.getContentPane().add((Component)canvas, BorderLayout.CENTER);
		
		j.setVisible(true);
	}
	
	public void init(GLAutoDrawable d) {
	}

	public void display(GLAutoDrawable d) {
	}
	
	public void reshape(GLAutoDrawable d, int i, int x, int width, int height) {
	}
	
	public void displayChanged(GLAutoDrawable d, boolean modeChanged, boolean deviceChanged) {
	}

}

When using a GLCanvas instead of a GLJPanel, everything works fine (well, nothing gets drawn, obviously).

BTW, I’ve had this problem with several previous JOGL versions as well.

Any ideas?

Regards –

Torsten

I have exact the same problem:

Simple code:


package sztejkat.gui.gl;
import javax.swing.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*; 

public class Test1
{
	public static void main(String [] args)
	{
		JFrame f = new JFrame("XXX");
		
		f.getContentPane().add(new GLJPanel());
		
		f.setVisible(true);
	};
	
};

fails like this:


Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Error making context current
        at com.sun.opengl.impl.x11.X11GLContext.makeCurrentImpl(X11GLContext.java:141)
        at com.sun.opengl.impl.x11.X11OffscreenGLContext.makeCurrentImpl(X11OffscreenGLContext.java:74)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:661)
        at javax.swing.JComponent.paint(JComponent.java:1027)
        at javax.swing.JComponent.paintChildren(JComponent.java:864)
  (....)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

While I change GLJPanel to GLCanvas it works. Same for examples - those with canvas works, those with panel - doesn’t.

java -version
java version “1.6.0_06”
Java™ SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot™ Server VM (build 10.0-b22, mixed mode)

Debian Lenny, intel cpu and intel G33 graphics card.

jogl 1.1.1 release

Torsten, have You solved it?

Regards,
Tomasz Sztejka.

Check your classpath (if in linux also your LD_LIBRARY_PATH) and make sure you are not mixing old release candidate libraries with new ones. I mean, don’t have the LD_LIBRARY_PATH point to the old .so files but using a newer set of jogl.jar and gluegen-rt.jar.

I have similar problem, if not exactly the same. I get the same error message with a program of my own.

However, it works on my old laptop (pentium3), but not on my stationary computer (dual core 2).

I’m using ubuntu with java6 update 6, and jogl 1.1.1 on both computers

I figured it was some threading error (I’m new to jogl and java, so I don’t really know how this works) which made crash on multicore systems.

Maybe I’m way off! If someone knows why please enlighten me.

You need to post the exact error message and if possible the full stacktrace to enable us to help you. And please start a new topic if your problem is not exactly the same.