Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  DirectByteBuffer ClassCastException in MacOSXOnscreenGLDrawable.lockSurface  (Read 987 times)
0 Members and 1 Guest are viewing this topic.
Offline AaronStewart

JGO n00b
*

Posts: 1



« on: 2008-07-11 23: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

JGO n00b
*

Posts: 2



« Reply #1 on: 2008-07-17 17: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

JGO n00b
*

Posts: 2



« Reply #2 on: 2008-10-09 16:27:57 »

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

The problem is gone.

--JavaBob
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.085 seconds with 21 queries.