GLException: Error making context current

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

GLException: Error making context current

Sandhase
Hello again,

I have an 3D Plot which uses an older version of JOGL. Now I have included this Plot in an applet which i want to display on a webpage.

It's all fine and the applet starts without any error messages. But there's nothing to see, too. the page is just white.

in the java console i see, that the applet starts correct and the init and start methods are called.
The data for the plot is correct.

i just get an error when closing the tab :

java.lang.reflect.InvocationTargetException
at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.media.opengl.GLException:Error making context current: 0x0
at com.sun.opengl.impl.windows.wgl.WindowsWGLContext.makeCurrentImpl(WindowsWGLContext.java:309)
at com.sun.opengl.impl.windows.wgl.WindowsOnscreenWGLContext.makeCurrentImpl(WindowsOnscreenWGLContext.java:65)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:151)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLdrawableHelper.java:141)
at javax.media.opengl.awt.GLCanvas.dispose(GLCanvas.java:324)
at javax.media.opengl.awt.GLCanvas.removeNotify(GLCanvas.java:434)
at java.awt.Container.removeNotify(Unknown Source)
at java.awt.Container.remove(Unknown Source)
at java.awt.Container.remove(Unknown Source)
at sun.plugin2.applet.Plugin2manager$AppletExecutionRunnable$7.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Ausnahme: java.lang.reflect.InvocationTargetException

Any idea what might cause this strange behaviour?
br
Sandhase
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

gouessej
Administrator
Hi!

Just use a more recent build for your deployment as this bug has been fixed recently.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Sandhase
Hey,

I'm afraid this is not possible.

The plot is part of another application and it's not possible to change the JOGL version due to changes in the package structure.

The plot works very well when deployed with the application. there are no errors.

Or is this bug just related to applets?

BR
sandhase
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Wade Walker
Administrator
Sometimes with old JOGL (I assume you mean JOGL 1.1.1a), the all-white screen means you need to set -Dsun.awt.noerasebackground=true. This prevents AWT from drawing over your image with all white during its background erase
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Sandhase
Hey,

thanks for the tip.

I don't know exactly which JOGL Version i use. The ReadMe says it is a 2.0 version but i don't know the built number.
But it contains the sun packages and no jogamp packages, so it must be before the JOGL project moves to jogamp homepage

i tried your advice wade, but it did not work.
i hope this param was correct:

BR
sandhase
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Sandhase
Sorry..here's the param attribute:
<pa ram name="java_arguments" value="-Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true">
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Wade Walker
Administrator
It looks like there's a space in "param" -- is that intentional?
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Sandhase
Yep,

if i do not add a space or something in the param tag it'll not be displayed here...

news:

there might be a problem with heavyweight and leightweight components and their paint methods.

i've created a small program which works like the real application the openGL plot comes from.
an MDI with JInternalFrames and added the widget on such a InternalFrame, like in the original program.

Does not work, but the original program works. Strange.

Is it possible to simply change GLCanvas to a GLPanel?

BR
Reply | Threaded
Open this post in threaded view
|

Re: GLException: Error making context current

Sandhase
Some Hours and try-and-error sessions later i finally see something.

BUt theres still a problem.

I have now a JApplet with a MDI (JDestopPane) and added a JInternalFrame to this MDI.
This JInternalFrame has a Toolbar and 2 JPanels..one of this JPanel uses JOGL.
So i get the window, but only the Toolbar.
The 2 JPanels are not displayed and i get this error:

java.lang.Exception: JAWT Surface previously locked by thread applet-applets.OpenGLPlotApplet-1
 at com.sun.nativewindow.impl.jawt.JAWTWindow.lockSurface(JAWTWindow.java:108)
 at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:60)
 at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:144)
 at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealizedImpl(WindowsWGLDrawable.java:68)
 at com.sun.opengl.impl.GLDrawableImpl.setRealized(GLDrawableImpl.java:120)
 at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
 at java.awt.Container.addNotify(Unknown Source)
 at javax.swing.JComponent.addNotify(Unknown Source)
 at java.awt.Container.addNotify(Unknown Source)
 at javax.swing.JComponent.addNotify(Unknown Source)
 at java.awt.Container.addNotify(Unknown Source)
 at javax.swing.JComponent.addNotify(Unknown Source)
 at java.awt.Container.addNotify(Unknown Source)
 at javax.swing.JComponent.addNotify(Unknown Source)
 at javax.swing.JRootPane.addNotify(Unknown Source)
 at java.awt.Container.addNotify(Unknown Source)
 at javax.swing.JComponent.addNotify(Unknown Source)
 at java.awt.Container.addImpl(Unknown Source)
 at javax.swing.JLayeredPane.addImpl(Unknown Source)
 at javax.swing.JDesktopPane.addImpl(Unknown Source)
 at java.awt.Container.add(Unknown Source)
 at applets.OpenGLPlotApplet.init(OpenGLPlotApplet.java:59)
 at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
Exception in thread "Timer-2" javax.media.opengl.GLException: javax.media.nativewindow.NativeWindowException: JAWT Surface already locked - AWT-EventQueue-2 JAWT-Window[windowHandle 0x0, surfaceHandle 0x0, pos 0/0, size 0x0, visible true, locked true,
 config class javax.media.nativewindow.awt.AWTGraphicsConfiguration[class javax.media.nativewindow.awt.AWTGraphicsScreen[class javax.media.nativewindow.awt.AWTGraphicsDevice[type AWT, awtDevice Win32GraphicsDevice[screen=0], handle 0x0], idx 0],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 sun.awt.Win32GraphicsConfig@182f0db[dev=Win32GraphicsDevice[screen=0],pixfmt=0],
 encapsulated WindowsWGLGraphicsConfiguration[class javax.media.nativewindow.DefaultGraphicsScreen[class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0], idx 0], pfdID -1, wglChoosen false,
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]],
 wrappedWindow AWT-GLCanvas[ class javax.media.nativewindow.awt.AWTGraphicsConfiguration[class javax.media.nativewindow.awt.AWTGraphicsScreen[class javax.media.nativewindow.awt.AWTGraphicsDevice[type AWT, awtDevice Win32GraphicsDevice[screen=0], handle 0x0], idx 0],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 sun.awt.Win32GraphicsConfig@182f0db[dev=Win32GraphicsDevice[screen=0],pixfmt=0],
 encapsulated WindowsWGLGraphicsConfiguration[class javax.media.nativewindow.DefaultGraphicsScreen[class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0], idx 0], pfdID -1, wglChoosen false,
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]], com.sun.opengl.impl.windows.wgl.WindowsOnscreenWGLDrawable, GLEventListeners num 1 [gui.widgets.openGlPlot.openGLMode@97eded, ]]]
 at com.sun.opengl.impl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:101)
 at com.sun.opengl.impl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:190)
 at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:164)
 at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:551)
 at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:290)
 at com.sun.opengl.util.AnimatorImpl.display(AnimatorImpl.java:50)
 at com.sun.opengl.util.Animator.display(Animator.java:154)
 at com.sun.opengl.util.FPSAnimator$1.run(FPSAnimator.java:95)
 at java.util.TimerThread.mainLoop(Unknown Source)
 at java.util.TimerThread.run(Unknown Source)
Caused by: javax.media.nativewindow.NativeWindowException: JAWT Surface already locked - AWT-EventQueue-2 JAWT-Window[windowHandle 0x0, surfaceHandle 0x0, pos 0/0, size 0x0, visible true, locked true,
 config class javax.media.nativewindow.awt.AWTGraphicsConfiguration[class javax.media.nativewindow.awt.AWTGraphicsScreen[class javax.media.nativewindow.awt.AWTGraphicsDevice[type AWT, awtDevice Win32GraphicsDevice[screen=0], handle 0x0], idx 0],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 sun.awt.Win32GraphicsConfig@182f0db[dev=Win32GraphicsDevice[screen=0],pixfmt=0],
 encapsulated WindowsWGLGraphicsConfiguration[class javax.media.nativewindow.DefaultGraphicsScreen[class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0], idx 0], pfdID -1, wglChoosen false,
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]],
 wrappedWindow AWT-GLCanvas[ class javax.media.nativewindow.awt.AWTGraphicsConfiguration[class javax.media.nativewindow.awt.AWTGraphicsScreen[class javax.media.nativewindow.awt.AWTGraphicsDevice[type AWT, awtDevice Win32GraphicsDevice[screen=0], handle 0x0], idx 0],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 sun.awt.Win32GraphicsConfig@182f0db[dev=Win32GraphicsDevice[screen=0],pixfmt=0],
 encapsulated WindowsWGLGraphicsConfiguration[class javax.media.nativewindow.DefaultGraphicsScreen[class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0], idx 0], pfdID -1, wglChoosen false,
 requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
 chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]], com.sun.opengl.impl.windows.wgl.WindowsOnscreenWGLDrawable, GLEventListeners num 1 [gui.widgets.openGlPlot.openGLMode@97eded, ]]]
 at com.sun.nativewindow.impl.jawt.JAWTWindow.lockSurface(JAWTWindow.java:106)
 at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:60)
 at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:144)
 at com.sun.opengl.impl.windows.wgl.WindowsOnscreenWGLContext.makeCurrentImpl(WindowsOnscreenWGLContext.java:59)
 at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:151)
 at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:141)
 at javax.media.opengl.awt.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:637)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)

Any Idea? is it possible to manually unlock this JAWT Surface, so it can be locked by the JOGL Panel I think?

BR