Error running JGears demo ("Error making context current") EDITED

Hi again,

yes, it’s here again this “newbie” asking about Linux…

I installed yesterday Ubuntu, to try if other distribution could come with drivers solving my problem. I have to say that Ubuntu seems more stable, and it seems a good option.

My problems comes again with JOGL and Swing. Sorry to come back again to this question, but I’m getting a completely different error and may be you can give me a hint.

I’m trying again to run the JGears demo. Both from the WebStart version and the one I build with Eclipse I get an exception and the program crashes. When running it I get this output at the Java Console (EDITED, IT WASN’T COMPLETE BEFORE, MAY BE I’M WRONG ABOUT THE EXCEPTION):

java.lang.reflect.InvocationTargetException
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)
	at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1323)
	at com.sun.opengl.util.Animator.display(Animator.java:158)
	at com.sun.opengl.util.Animator$MainLoop.run(Animator.java:181)
	at java.lang.Thread.run(Thread.java:619)
Caused by: 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 demos.jgears.JGears.paintComponent(JGears.java:60)
	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.paintToOffscreen(JComponent.java:5122)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5070)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:723)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
	at com.sun.opengl.util.Animator$1.run(Animator.java:302)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
	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)
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 demos.jgears.JGears.paintComponent(JGears.java:60)
	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.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)
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x9084cfd7, pid=12887, tid=2337069968
#
# Java VM: Java HotSpot(TM) Server VM (10.0-b22 mixed mode linux-x86)
# Problematic frame:
# C  [libX11.so.6+0x2dfd7]  XQueryExtension+0x17
#
# An error report file with more information is saved as:
# /home/pedro/workspace/Demos-JOGL/hs_err_pid12887.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


The line refferenced “at demos.jgears.JGears.paintComponent(JGears.java:60)” is:
59: public void paintComponent(Graphics g) {
60: super.paintComponent(g); // THIS ONE

Any clue?

Thanks!!!
Pedro

Well, as expected, it also happens in my own application. I got:

Exception occurred during event dispatching:
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.pumpEventsForFilter(EventDispatchThread.java:177)
	at java.awt.Dialog$1.run(Dialog.java:1045)
	at java.awt.Dialog$3.run(Dialog.java:1097)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Dialog.show(Dialog.java:1095)
	at java.awt.Component.show(Component.java:1422)
	at java.awt.Component.setVisible(Component.java:1375)
	at java.awt.Window.setVisible(Window.java:806)
	at java.awt.Dialog.setVisible(Dialog.java:985)
	at pfp.jtracer3d.JTracer3D.edicionMaterial(JTracer3D.java:291)
	at pfp.jtracer3d.JTracer3D.actionPerformed(JTracer3D.java:219)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
	at java.awt.Component.processMouseEvent(Component.java:6041)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
	at java.awt.Component.processEvent(Component.java:5806)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4413)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4243)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
	at java.awt.Container.dispatchEventImpl(Container.java:2102)
	at java.awt.Window.dispatchEventImpl(Window.java:2440)
	at java.awt.Component.dispatchEvent(Component.java:4243)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	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)
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x90709fd7, pid=6826, tid=2338708368
#
# Java VM: Java HotSpot(TM) Server VM (10.0-b22 mixed mode linux-x86)
# Problematic frame:
# C  [libX11.so.6+0x2dfd7]  XQueryExtension+0x17
#
# An error report file with more information is saved as:
# /home/pedro/workspace/JTracer3D/hs_err_pid6826.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

In this case, the exceptions occurs “at pfp.jtracer3d.JTracer3D.edicionMaterial(JTracer3D.java:291)”, that is:
dialog.setVisible(true); // It’s a Dialog box with a GLJPanel inside.

The Java VM crashes when closing the dialog, but it states outside the VM in native code.

I could expect the “Could not enable pipeline” error, as I had previously with Fedora 9, but this new behaviour is driving me crazy.

Anyone here has seen something like this? I’m afraid that I can’t expect JOGL running in Linux… it seems that not only the graphic driver is important.

Thanks,
Pedro

I think my brother had a similar error after installing ubuntu. His driveres didnt work right. You should double check your drivers.