Bug 467 - invokeAndWait exception exclusive to MacOS and Safari browser
Summary: invokeAndWait exception exclusive to MacOS and Safari browser
Alias: None
Product: Jogl
Classification: JogAmp
Component: applet (show other bugs)
Version: 2
Hardware: All macosx
: --- normal
Assignee: Sven Gothel
Depends on:
Reported: 2011-02-08 22:42 CET by Vincent Ly
Modified: 2011-11-18 08:24 CET (History)
2 users (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Ly 2011-02-08 22:42:42 CET
Starting the applet results in an invokeAndWait exception in any browser operating on the MacOS and any OS running the Safari browser.

Steps to reproduce:
-Using macOS, go to http://jogamp.org/jogl-demos/www/applettest.html
-Using Safari, go to http://jogamp.org/jogl-demos/www/applettest.html

Actual Results:
Application hangs on the Starting Applet JOGL Applet Test loading screen.

Expected Results:
Application should display spinning gears.

Build Date and Platform:
8 February 2010 - Mac OS X 10.6.6 and Safari on Windows Vista

Does not occur on Linux or Vista with Firefox or Chrome.  Does occur with Safari with Vista.  Does occur with Firefox on Mac OS X 10.6.6.


JNLPAppletLauncher: static initializer
GearsApplet: init() - begin
Exception in thread "AWT-EventQueue-3" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1017)
	at com.jogamp.nativewindow.impl.jawt.JAWTUtil.<clinit>(JAWTUtil.java:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.jogamp.common.util.ReflectionUtil.callMethod(ReflectionUtil.java:267)
	at javax.media.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:199)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1090)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:66)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:111)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:109)
	at demos.applets.GearsApplet.init(GearsApplet.java:19)
	at org.jdesktop.applet.util.JNLPAppletLauncher.startSubApplet(JNLPAppletLauncher.java:1987)
	at org.jdesktop.applet.util.JNLPAppletLauncher.access$200(JNLPAppletLauncher.java:661)
	at org.jdesktop.applet.util.JNLPAppletLauncher$5.run(JNLPAppletLauncher.java:1324)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
	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)
GearsApplet: stop() - begin
	at demos.applets.GearsApplet.stop(GearsApplet.java:38)
	at org.jdesktop.applet.util.JNLPAppletLauncher.stop(JNLPAppletLauncher.java:930)
	at sun.applet.AppletPanel.run(AppletPanel.java:525)
	at java.lang.Thread.run(Thread.java:680)
Comment 1 Wade Walker 2011-03-16 03:55:43 CET
This works for me on OS X 10.6.6, Java 1.6.0_24-b07-334, Safari 5.0.4 (6533.20.27), NVIDIA GeForce 320M. Could you tell us your versions of the above?
Comment 2 Cyrille 2011-05-17 14:07:25 CEST
I notice a similar stacktrace with 2.0-b11-20101213-windows-i586 (commit e735c312c874ae6abc401b4765b24a83f5238a99) when I create a GLCanvas on Swing's event dispatching thread (by calling SwingUtilities.invokeAndWait()).
This is consistent with the fact that stacktrace's top is java.awt.EventQueue.invokeAndWait that does clearly not support being called from Swing's EDT.

I upgraded Jogl to signed rc2 (commit bcf5d6ac871a29398b441df617923d3dd2cf35c1) and I got rid of that fatal error when creating my GLCanvas on EDT. I still notice a weird NullPointerException exception being thrown with the following stacktrace:
Thread [AWT-EventQueue-0] (Suspended (exception NullPointerException))	
	JAWTUtil$1.run() line: 105	
	AccessController.doPrivileged(PrivilegedAction<T>) line: not available [native method]	
	JAWTUtil.<clinit>() line: 100	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available	
	Method.invoke(Object, Object...) line: not available	
	ReflectionUtil.callMethod(Object, Method, Object[]) line: 266	
	NativeWindowFactory.initSingleton(boolean) line: 203	
	GLProfile.initProfilesForDefaultDevices(boolean) line: 1164	
	GLProfile.access$000(boolean) line: 71	
	GLProfile$1.run() line: 117	
	AccessController.doPrivileged(PrivilegedAction<T>) line: not available [native method]	
	GLProfile.initSingleton(boolean) line: 115	
	GLProfile.validateInitialization() line: 1428	
	GLProfile.getProfileMap(AbstractGraphicsDevice) line: 1580	
	GLProfile.get(AbstractGraphicsDevice, String[]) line: 642	
	GLProfile.get(String[]) line: 657	
	GLProfile.getMaxFixedFunc() line: 547	
	GLCanvas.<clinit>() line: 498

This null pointer exception is not fatal but it may not be a wanted behaviour, though.
BTW, I'm wondering whether creating a GLCanvas from EDT is a supported feature. Never read anything that disproves this assumption but...
Comment 3 Sven Gothel 2011-11-18 08:24:48 CET
at the time of writing, we had no OS X browser / applet support, which is comming up w/ RC4.