Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  JOGL Now Crashing (Fixed)  (Read 1120 times)
0 Members and 1 Guest are viewing this topic.
Offline JavaIsGood

Junior Newbie





« Posted 2009-07-29 02:28:11 »

Hello everyone and thanks for reading my post!

I am having trouble getting the new version of JOGL to work on my computer (I am currently running Windows XP); it was working well before, but now I receive a RuntimeException and my programs crash upon startup:

Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT
        at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
        at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:69)
        at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:121)
        at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealized(WindowsWGLDrawable.java:70)
        at glux.awt.GLXCanvas.addNotify(GLXCanvas.java:192)
        at java.awt.Container.addNotify(Container.java:2578)
        at javax.swing.JComponent.addNotify(JComponent.java:4685)
        at java.awt.Container.addNotify(Container.java:2578)
        at javax.swing.JComponent.addNotify(JComponent.java:4685)
        at java.awt.Container.addNotify(Container.java:2578)
        at javax.swing.JComponent.addNotify(JComponent.java:4685)
        at java.awt.Container.addNotify(Container.java:2578)
        at javax.swing.JComponent.addNotify(JComponent.java:4685)
        at javax.swing.JRootPane.addNotify(JRootPane.java:739)
        at java.awt.Container.addNotify(Container.java:2578)
        at java.awt.Window.addNotify(Window.java:662)
        at java.awt.Frame.addNotify(Frame.java:470)
        at java.awt.Window.show(Window.java:858)
        at java.awt.Component.show(Component.java:1563)
        at java.awt.Component.setVisible(Component.java:1515)
        at java.awt.Window.setVisible(Window.java:841)
        at test.GLXCanvasTest.initializeFrame(GLXCanvasTest.java:77)
        at test.GLXCanvasTest.<init>(GLXCanvasTest.java:48)
        at test.GLXCanvasTest.main(GLXCanvasTest.java:210)


I used a custom implementation of a GLCanvas which I modified for the new version of the API, so I tried using the GLCanvas provided with JOGL; however, more exceptions were thrown:

Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT
        at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
        at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:69)
        at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:121)
        at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealized(WindowsWGLDrawable.java:70)
        at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
        at java.awt.Container.addNotify(Container.java:2578)
        at java.awt.Window.addNotify(Window.java:662)
        at java.awt.Frame.addNotify(Frame.java:470)
        at java.awt.Window.show(Window.java:858)
        at java.awt.Component.show(Component.java:1563)
        at java.awt.Component.setVisible(Component.java:1515)
        at java.awt.Window.setVisible(Window.java:841)
        at test.JOGLAPP.<init>(JOGLAPP.java:31)
        at test.JOGLAPP.main(JOGLAPP.java:16)
java.lang.Exception: JAWT Surface previously locked by main
        at com.sun.nativewindow.impl.jawt.JAWTWindow.lockSurface(JAWTWindow.java:96)
        at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:60)
        at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:121)
        at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealized(WindowsWGLDrawable.java:70)
        at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
        at java.awt.Container.addNotify(Container.java:2578)
        at java.awt.Window.addNotify(Window.java:662)
        at java.awt.Frame.addNotify(Frame.java:470)
        at java.awt.Window.show(Window.java:858)
        at java.awt.Component.show(Component.java:1563)
        at java.awt.Component.setVisible(Component.java:1515)
        at java.awt.Window.setVisible(Window.java:841)
        at test.JOGLAPP.<init>(JOGLAPP.java:31)
        at test.JOGLAPP.main(JOGLAPP.java:16)
Exception in thread "AWT-EventQueue-0" javax.media.nativewindow.NativeWindowException: JAWT Surface already locked - AWT-EventQueue-0 JAWT-Window[windowHandle 0x0, surfaceHandle 0x0, pos 4/34, size 292x262, 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 D3DGraphicsDevice[screen=0],

...



It now mentions something about the AWT surface already being locked. I find this strange because everything was working well in the previous version; I suspect that I installed JOGL incorrectly (I did what I usually do and placed the files in the bin and lib/ext directories). If it helps, my programs always crash in the line where I call drawable.setRealized(true);. Why is there a problem initializing JAWT? Any help would be greatly appreciated; thank you very much!
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #1 - Posted 2009-07-29 03:57:07 »

Sounds like maybe a threading issue.  From the stack trace it looks like you are messing with Swing stuff from the main thread instead of the event dispatch thread.  Try wrapping your current main code with a SwingUtilities.invokeLater call.

Offline JavaIsGood

Junior Newbie





« Reply #2 - Posted 2009-07-29 08:10:50 »

Hello and thanks for the suggestion! After wrapping the code in main in SwingUtilities.invokeLater(...), I still received the same exception. I even copy-pasted some examples which were online and got the same problem, which makes me think that I did something wrong when I installed JOGL; however, my code compiled, so I don't understand what could have gone wrong... Huh

Edit 0: The class I used to cross-check with the exception my code was throwing can be found here: http://blog.rickyc.org/?p=39. I copy-pasted the code found there verbatim, which caused the second exception I noted in my original post. My guess at this point is that awt.dll and jawt.dll could not be found in the class which loads the native libraries; however, I'm pretty sure I installed everything correctly; I pasted the jogl files and dlls (along with awt.dll and jawt.dll) in bin and lib/ext. Did I do something wrong here?

Edit 1: I fixed the problem! Looks like copy-pasting all of the contents in the lib folder of the jogl installation package into the lib/ext and bin directories of the JDK is not a good idea. After only copying over the .dlls and the main jar files (jogl.all.jar, gluegen, and nativewindow), everything works!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (14 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!