Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  
  DirectByteBuffer ClassCastException in MacOSXOnscreenGLDrawable.lockSurface  (Read 1811 times)
0 Members and 1 Guest are viewing this topic.
Offline AaronStewart

Innocent Bystander





« Posted 2008-07-12 05:55:55 »

Hello,

I'm trying to compile a java application in Mac OS X (It works in Windows).
When I run the program from the Eclipse environment, the JOGL pane fails to show up and
I get this exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.nio.DirectByteBuffer
   at com.sun.opengl.impl.macosx.MacOSXOnscreenGLDrawable.lockSurface(MacOSXOnscreenGLDrawable.java:180)
   at com.sun.opengl.impl.macosx.MacOSXOnscreenGLContext.makeCurrentImpl(MacOSXOnscreenGLContext.java:57)
   at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
   at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
   at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:265)
   at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
   at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
   at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
   at sun.awt.RepaintArea.paint(RepaintArea.java:241)
   at apple.awt.ComponentModel.handleEvent(ComponentModel.java:268)
   at java.awt.Component.dispatchEventImpl(Component.java:4144)
   at java.awt.Component.dispatchEvent(Component.java:3903)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

I am using the latest released JARs and JNILIBs, specific for Mac OS X...

Any ideas?...

Regards,
Aaron Stewart
BYU chemistry software developer / student

Offline JavaBob

Junior Newbie





« Reply #1 - Posted 2008-07-17 23:25:53 »

I get the same exception under somewhat different circumstances.

I am converting from a Java Web Start application to a desktop application.  The Web Start application works fine!  I extracted all the jar files from the Web Start download libraries and packaged them in my install program, which installs my program nicely. On the command line, the desktop application gives me the stack trace:

dyn-25-251:PathwayEditorWebIndependent workbenchdev$ java -classpath . -jar PathwayEditorWebIndependent.jar

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
java.nio.DirectByteBuffer
        at
com.sun.opengl.impl.macosx.MacOSXOnscreenGLDrawable.lockSurface(MacOSXOnscreenGLDrawable.java:177)
        at
com.sun.opengl.impl.macosx.MacOSXOnscreenGLContext.makeCurrentImpl(MacOSXOnscreenGLContext.java:57)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:127)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at
javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:258)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
        at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
        at sun.awt.RepaintArea.paint(RepaintArea.java:241)
        at apple.awt.ComponentModel.handleEvent(ComponentModel.java:268)
        at java.awt.Component.dispatchEventImpl(Component.java:4144)
        at java.awt.Component.dispatchEvent(Component.java:3903)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

All the jnilib files were extracted from the May 22, 2008 releases of jar files contained in http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/

FYI, the classpath in the manifest file in the PathwayEditorWebIndependent.jar file is:

Class-Path: . jogl.dll jogl_awt.dll jogl_cg.dll jogl.jar gluegen-rt.jar libgluegen-rt.jnilib libjogl.jnilib libjogl_awt.jnilib libjogl_cg.jnilib

(The installer program works on both Windows and Mac OS X)

The main window for the application displays as it should, but I can't draw on the display panel.
Offline JavaBob

Junior Newbie





« Reply #2 - Posted 2008-10-09 22:27:57 »

I just now downloaded jogl-1.1.1-rc8-macosx-universal.zip and tried it.

The problem is gone.

--JavaBob
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 (26 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (55 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!