[Mac OS X] java.lang.ClassCastException

95 views
Skip to first unread message

ak

unread,
Feb 7, 2010, 2:05:25 AM2/7/10
to Jzy3d
Hi.

I really enjoyed Jzy3d on WIndows PC, but it doesn't work on Mac OS X.

I got an error message when runing the Launcher.java as a Java
Application.

Before running the demo, I changed swt.jar and swt-debug.jar to Mac OS
X compatible version and add -d32 option to java VM argument to run
the demo with 32 bit java version.

2010-02-07 15:59:17.838 java[2495:a07] [Java CocoaComponent
compatibility mode]: Enabled
2010-02-07 15:59:17.839 java[2495:a07] [Java CocoaComponent
compatibility mode]: Setting timeout for SWT to 0.100000
2010-02-07 15:59:19.783 java[2495:a07] *** __NSAutoreleaseNoPool():
Object 0x159f80 of class NSConcreteMapTableValueEnumerator
autoreleased with no pool in place - just leaking
2010-02-07 15:59:19.789 java[2495:a07] *** __NSAutoreleaseNoPool():
Object 0x11e460 of class __NSCFDate autoreleased with no pool in place
- just leaking
2010-02-07 15:59:19.792 java[2495:a07] *** __NSAutoreleaseNoPool():
Object 0x111aa10 of class NSCFTimer autoreleased with no pool in place
- just leaking
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
java.nio.DirectByteBuffer cannot be cast to
com.sun.opengl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo
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:
301)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:133)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:166)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
at sun.awt.RepaintArea.paint(RepaintArea.java:241)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:263)
at java.awt.Component.dispatchEventImpl(Component.java:4790)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
296)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
211)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Martin Pernollet

unread,
Feb 7, 2010, 7:00:56 AM2/7/10
to jz...@googlegroups.com
Thanks for info. I can't help you since I'm on windows. Maybe some JOGL related forums can explain the problem.

Martin Pernollet

unread,
Feb 7, 2010, 7:12:44 AM2/7/10
to jz...@googlegroups.com
One of us had a problem related to colorbar rendering on mac:

maybe it is related? To hidde the colorbar you should:
Drawable.setFace2dDisplayed(false); // activate object's colorbar display

2010/2/7 Martin Pernollet <martin.p...@gmail.com>

Massimiliano

unread,
Feb 8, 2010, 10:58:56 AM2/8/10
to Jzy3d
Hi guys,

I was the one with the colorbar issues, the code didn't throw any
exception though.

However, at the beginning, I had issues with JOGL: on Leopard java 6
is 64bit (probably it's the same for Snow Leopard) and the JOGL
binaries distributed in the website are compiled for 32bit, so the
native library is not compatible with the 64bit JVM. Thus I try to run
everything with Java 1.5 32bit, but the thing wouldn't work, I had a
bunch of exceptions as soon as the JZY3D code was loaded (or the JOGL
code, I am not sure). I don't remember the error/exception messages,
but it could be the same problem ak is describing above.
What i suggest is that he moves to Java 6 64bit. Ak, for that matter,
I suggest you don't waste time attempting to recompile JOGL for
64bits, it's just a mess, I spent half an hour on it and then, while I
was googling for the errors I was getting when trying to use the
native libraries I had just compiled, I stumbled upon the worldwind
forum. Worldwind http://worldwind.arc.nasa.gov/java/ uses JOGL too,
and in the distribution JOGL is compiled for all the architectures,
Mac-OS 64 included. I suggest you download and use those native
libraries with Java 6.

On Feb 7, 7:12 am, Martin Pernollet <martin.pernol...@gmail.com>
wrote:
> One of us had a problem related to colorbar rendering on mac:http://groups.google.com/group/jzy3d/browse_thread/thread/658c579da0d...http://dl.dropbox.com/u/234787/Stuff/osx.png
>
> <http://groups.google.com/group/jzy3d/browse_thread/thread/658c579da0d...>maybe


> it is related? To hidde the colorbar you should:
> Drawable.setFace2dDisplayed(false); // activate object's colorbar display
>

> 2010/2/7 Martin Pernollet <martin.pernol...@gmail.com>


>
>
>
> > Thanks for info. I can't help you since I'm on windows. Maybe some JOGL
> > related forums can explain the problem.
>

> > 2010/2/7 ak <akihito.s...@gmail.com>

Akihito Sudo

unread,
Feb 9, 2010, 9:55:00 PM2/9/10
to jz...@googlegroups.com
Thanks a lot, guys!

I'll try to use libraries in the package of the NASA World Wind as
mentioned by Massimiliano, and report the result here. (Thank you
Massimiliano :-)
I work on Windows PC at daytime, so my report may appear on this weekend.

ak

unread,
Feb 19, 2010, 7:52:02 PM2/19/10
to Jzy3d

Hi.

I finally succeeded to run the demo application on Mac OS 10.6 (snow
leopard). Thank you, Massimilliano and Martin. But the way to do this
is tricky. I deleted all jzy3d code which is depend on SWT. I had
found out that there are two issues when running jzy3d on Mac OS 10.6.
One is JOGL compatibility and the other is SWT compatibility.

As Massimilliano mentioned, we could get JOGL compatible to Mac OS
10.6 from the NASA world wind. But, I didn't run any SWT application
on Mac OS 10.6 and Java 6 (both 32bit and 64bit). I deleted all SWT
depending code and replaced the JOGL libraries to those in the world
wind. The demo application works without any problem now.

Can any problem happen when running jzy3d without the SWT depending
classes?

Thanks.

On Feb 10, 11:55 am, Akihito Sudo <akihito.s...@gmail.com> wrote:
> Thanks a lot, guys!
>
> I'll try to use libraries in the package of the NASA World Wind as
> mentioned by Massimiliano, and report the result here. (Thank you
> Massimiliano :-)
> I work on Windows PC at daytime, so my report may appear on this weekend.
>
>
>
> On Tue, Feb 9, 2010 at 12:58 AM, Massimiliano <emaildel...@gmail.com> wrote:
> > Hi guys,
>
> > I was the one with the colorbar issues, the code didn't throw any
> > exception though.
>
> > However, at the beginning, I had issues with JOGL: on Leopard java 6
> > is 64bit (probably it's the same for Snow Leopard) and the JOGL
> > binaries distributed in the website are compiled for 32bit, so the
> > native library is not compatible with the 64bit JVM. Thus I try to run
> > everything with Java 1.5 32bit, but the thing wouldn't work, I had a
> > bunch of exceptions as soon as the JZY3D code was loaded (or the JOGL
> > code, I am not sure). I don't remember the error/exception messages,
> > but it could be the same problem ak is describing above.
> > What i suggest is that he moves to Java 6 64bit. Ak, for that matter,
> > I suggest you don't waste time attempting to recompile JOGL for
> > 64bits, it's just a mess, I spent half an hour on it and then, while I
> > was googling for the errors I was getting when trying to use the
> > native libraries I had just compiled, I stumbled upon the worldwind

> > forum. Worldwindhttp://worldwind.arc.nasa.gov/java/uses JOGL too,


> > and in the distribution JOGL is compiled for all the architectures,
> > Mac-OS 64 included. I suggest you download and use those native
> > libraries with Java 6.
>
> > On Feb 7, 7:12 am, Martin Pernollet <martin.pernol...@gmail.com>
> > wrote:
> >> One of us had a problem related to colorbar rendering on mac:http://groups.google.com/group/jzy3d/browse_thread/thread/658c579da0d...
>

Reply all
Reply to author
Forward
0 new messages