Here is the exception with NewtAwt+JavaFX under Mac OS X:
java.lang.IllegalArgumentException: No registered NativeWindowFactory for class com.ardor3d.framework.jogl.JoglNewtAwtCanvas at javax.media.nativewindow.NativeWindowFactory.getFactory(NativeWindowFactory.java:477) at javax.media.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:514) at jogamp.newt.awt.NewtFactoryAWT.getNativeWindow(NewtFactoryAWT.java:70) at com.jogamp.newt.awt.NewtCanvasAWT.reparentWindow(NewtCanvasAWT.java:428) at com.jogamp.newt.awt.NewtCanvasAWT.addNotify(NewtCanvasAWT.java:391) at java.awt.Container.addNotify(Container.java:2769) at javax.swing.JComponent.addNotify(JComponent.java:4743) at java.awt.Container.addNotify(Container.java:2769) at javax.swing.JComponent.addNotify(JComponent.java:4743) at java.awt.Container.addNotify(Container.java:2769) at javax.swing.JComponent.addNotify(JComponent.java:4743) at java.awt.Container.addNotify(Container.java:2769) at javax.swing.JComponent.addNotify(JComponent.java:4743) at java.awt.Container.addNotify(Container.java:2769) at javax.swing.JComponent.addNotify(JComponent.java:4743) at javax.swing.JRootPane.addNotify(JRootPane.java:756) at java.awt.Container.addNotify(Container.java:2769) at java.awt.Window.addNotify(Window.java:770) at java.awt.Frame.addNotify(Frame.java:487) at java.awt.Window.show(Window.java:1031) at java.awt.Component.show(Component.java:1651) at java.awt.Component.setVisible(Component.java:1603) at java.awt.Window.setVisible(Window.java:1014) at org.concord.energy3d.MainApplication.main(MainApplication.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Thread.java:722)
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
In reply to this post by runiter
Instructions for building JOGL in Eclipse are at http://jogamp.org/wiki/index.php/Building_JOGL_in_Eclipse.
---- "runiter [via jogamp]" <[hidden email]> wrote: > > > I understand and I appreciate it. But since there are no instructions on how > to compile and run JOGL in eclipse I'm at the mercy of your volunteer time. > If there was a clear tutorial on how to compile JOGL in eclipse perhaps I > could've been of some help. > > > > ----- > Sign this petition to demand Oracle remove Ask Toolbar from Java: https://www.change.org/petitions/oracle-corporation-stop-bundling-ask-toolbar-with-the-java-installer > _______________________________________________ > If you reply to this email, your message will be added to the discussion below: > http://forum.jogamp.org/Javafx-causes-jogl-problem-in-mac-tp4028417p4028582.html > To start a new topic under jogl, email [hidden email] > To unsubscribe from jogamp, visit |
Administrator
|
In reply to this post by runiter
NativeWindowFactory should accept a class that extends NewtCanvasAWT. I don't see how to fix that.
Julien Gouesse | Personal blog | Website
|
I guess there is no point in fixing problem with Newt since even without JavaFX it doesn't work properly in Mac OS X. So if you could just fix the original cast problem in JoglAwt it'll be great.
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
I have done that on GLCanvas:
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 63c18db..160c270 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -1178,21 +1178,26 @@ AWTGraphicsConfiguration config = null; if( EventQueue.isDispatchThread() || Thread.holdsLock(getTreeLock()) ) { - config = (AWTGraphicsConfiguration) - GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen, - capsRequested, - chooser, aScreen, VisualIDHolder.VID_UNDEFINED); + AbstractGraphicsConfiguration a = GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen, + capsRequested, + chooser, aScreen, VisualIDHolder.VID_UNDEFINED); + if (a instanceof AWTGraphicsConfiguration) { + config = (AWTGraphicsConfiguration) a; + } + } else { try { final ArrayList<AWTGraphicsConfiguration> bucket = new ArrayList<AWTGraphicsConfiguration>(1); EventQueue.invokeAndWait(new Runnable() { @Override public void run() { - AWTGraphicsConfiguration c = (AWTGraphicsConfiguration) - GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen, - capsRequested, - chooser, aScreen, VisualIDHolder.VID_UNDEFINED); - bucket.add(c); + AbstractGraphicsConfiguration a = GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen, + capsRequested, + chooser, aScreen, VisualIDHolder.VID_UNDEFINED); + if (a instanceof AWTGraphicsConfiguration) { + AWTGraphicsConfiguration c = (AWTGraphicsConfiguration) a; + bucket.add(c); + } } }); config = ( bucket.size() > 0 ) ? bucket.get(0) : null ; but the problem will still be there, you will just get an error message "Error: Couldn't fetch AWTGraphicsConfiguration" instead of the ClassCastException. The problem is that a DefaultGraphicsConfiguration is returned instead of the one for AWT. The other bug with NewtCanvasAWT will have to be fixed too. @Sven, if you have an idea, let me know.
Julien Gouesse | Personal blog | Website
|
Administrator
|
In reply to this post by runiter
On 03/12/2013 03:30 PM, runiter [via jogamp] wrote:
> Here is the exception with NewtAwt+JavaFX under Mac OS X: > Semantics, the getFactory(Class<?> clazz) shall return a registered NativeWindowFactory implementation for the given class. The given class is traversed up until it's super class until found. If not found (i.e. not registered) the exception is thrown. > > java.lang.IllegalArgumentException: No registered NativeWindowFactory for > class com.ardor3d.framework.jogl.JoglNewtAwtCanvas > at > javax.media.nativewindow.NativeWindowFactory.getFactory(NativeWindowFactory.java:477) > > at > javax.media.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:514) > > at jogamp.newt.awt.NewtFactoryAWT.getNativeWindow(NewtFactoryAWT.java:70) > at > com.jogamp.newt.awt.NewtCanvasAWT.reparentWindow(NewtCanvasAWT.java:428) > at com.jogamp.newt.awt.NewtCanvasAWT.addNotify(NewtCanvasAWT.java:391) > public static NativeWindowFactory getFactory(Class<?> windowClass) throws IllegalArgumentException { > if (nativeWindowClass.isAssignableFrom(windowClass)) { > return registeredFactories.get(nativeWindowClass); > } > Class<?> clazz = windowClass; > while (clazz != null) { > NativeWindowFactory factory = registeredFactories.get(clazz); > if (factory != null) { > return factory; > } > clazz = clazz.getSuperclass(); > } > throw new IllegalArgumentException("No registered NativeWindowFactory for class " + windowClass.getName()); > } NativeWindowFactory.registerFactory() interface javax.media.nativewindow.NativeWindow -> jogamp.nativewindow.NativeWindowFactoryImpl@70453807 If AWT is enabled/available: NativeWindowFactory.registerFactory() class java.awt.Component -> jogamp.nativewindow.NativeWindowFactoryImpl@70453807 +++ Passing NewtCanvasAWT Works: - 'public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProtocol, OffscreenLayerOption' - NewtCanvasAWT extends java.awt.Canvas extends java.awt.Component Passing JoglNewtAwtCanvas Does not work: - 'public class JoglNewtAwtCanvas extends NewtCanvasAWT implements Canvas, NewtWindowContainer' - JoglNewtAwtCanvas extends NewtCanvasAWT extends java.awt.Canvas extends java.awt.Component I am a bit lost myself here .., clazz.getSuperclass() should traverse through the above list and eventually find java.awt.Component. This would only not be not successful, if AWT is not enabled/available. ~Sven signature.asc (911 bytes) Download Attachment |
It occurs to me that adding the JavaFX component may somehow disable AWT in Mac OS X implementation. How can I check whether or not AWT is enabled? Also is there a way to printout the list of factories with debug flags?
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
On 03/14/2013 04:11 AM, runiter [via jogamp] wrote:
> Sven Gothel wrote > This would only not be not successful, if AWT is not enabled/available. > > It occurs to me that adding the JavaFX component may somehow disable AWT in > Mac OS X implementation. > How can I check whether or not AWT is enabled? https://jogamp.org/wiki/index.php/Jogamp_Versioning_and_Releases#Runtime_Version_Check As I have finally updated the Wiki, you see the element: '... Java6: true, AWT enabled: true' The last one is Platform.AWT_ENABLED of GlueGen, you may check NativeWindowFactory.isAWTAvailable() as well. The latter on utilizes has further checks. > Also is there a way to printout the list of factories with debug flags? https://jogamp.org/wiki/index.php/Jogl_FAQ#Bugreports_.26_Testing -> https://jogamp.org/wiki/index.php/Jogamp_Versioning_and_Releases#Runtime_Debug_Logs Simply look into the test_dbg.log file (-> FAQ Bugreport), as created w/ 'sh etc/test_dbg.sh'. The latter uses all debug properties: -Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all ~Sven signature.asc (911 bytes) Download Attachment |
Administrator
|
In reply to this post by runiter
I know it is possible to force the use of Java2D with "-Dprism.order=j2d" or to force the use of OpenGL-ES with "-Dprism.order=es2,es1". You can also use "-Dprism.verbose=true" to get some more information.
Julien Gouesse | Personal blog | Website
|
Good news, I managed to find a workaround this problem by simply delaying the creation of JavaFX components until after Canvas is created. Right now I simply put JavaFX code in a thread that starts with a Thread.sleep(10000). It's an ugly workaround but it works.
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
Have you tried my suggestions?
Julien Gouesse | Personal blog | Website
|
Which suggestion? using "-Dprism.order=j2d"? yes i did try that and it didn't help. In fact after enabling verbose I noticed that it seem to fail to use OpenGL for GUI rendering so it seem to always fall back to j2d anyways.
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
If we have no way of preventing JavaFX from disabling AWT support, someone will have to write a bug report against JavaFX. Imagine that your workaround doesn't work any more in Java 1.8 :s JogAmp contributors should not fix JavaFX bugs and we won't be able to help you. I know no mean to re-enable AWT support. I don't know the side effects of your workaround, you shouldn't be satisfied by this even though it temporarily solves your problem.
Julien Gouesse | Personal blog | Website
|
Perhaps mixing JavaFX with Swing causes this problem and that had I used pure JavaFX it might have worked! I will give that a try and will let you know the result.
I remember one of the strong points of JavaFX was that it is supposed to work great with Java3D, I remember seeing a demo of it. Given that Java3D is now based on JOGL I imagine it should have worked. You mentioned that with your patch here the factory would return null because none of the items in the graphics list are a match. Is there a flag I can use to print out all the graphics in that list? I'm curious to know what graphics are available when AWT is not available.
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
JavaFX 1 worked very well with AWT, Java3D and JOGL 1 but not JavaFX 2.
You only get a single default factory, it can't be used for AWT.
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |