Well you know,
If the code looks like: public static void main(String[] args) { GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); } we will need more than jogamp-fat.jar (right?) In fact; final GraphicsEnvironment localGraphicsEnvironment = getLocalGraphicsEnvironment(); final GraphicsDevice defaultScreenDevice = localGraphicsEnvironment.getDefaultScreenDevice(); GraphicsConfiguration c[] = defaultScreenDevice .getConfigurations(); for (int i = 0; i < c.length; i++) { System.out.println("gc:" + i + ":" + c[i]); } GraphicsConfiguration gc = c[0]; Canvas3D c3d = new Canvas3D(gc); System.out.println("done"); needs more than jogamp-fat.jar Don't you need vecmath.jar j3dutils.jar j3dcore.jar, at the very least? If I have the correct versions of these things, what I get appears below. Thanks! - Doug public static void main(String[] args) { testGc(); } private static void testGc() { final GraphicsEnvironment localGraphicsEnvironment = getLocalGraphicsEnvironment(); final GraphicsDevice defaultScreenDevice = localGraphicsEnvironment.getDefaultScreenDevice(); GraphicsConfiguration c[] = defaultScreenDevice .getConfigurations(); for (int i = 0; i < c.length; i++) { System.out.println("gc:" + i + ":" + c[i]); } GraphicsConfiguration gc = c[0]; Canvas3D c3d = new Canvas3D(gc); System.out.println("done"); } /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -javaagent:/Applications/idea.app/Contents/lib/idea_rt.jar=62831:/Applications/idea.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/lyon/current/java/testHello/out/production/testHello:/Users/lyon/current/java/testHello/jars/jogamp-fat.jar:/Users/lyon/current/java/testHello/jars/j3dcore.jar:/Users/lyon/current/java/testHello/jars/j3dutils.jar:/Users/lyon/current/java/testHello/jars/vecmath.jar com.docjava.Main gc:0:CGLGraphicsConfig[dev=1317015680,pixfmt=0] WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (file:/Users/lyon/current/java/testHello/jars/j3dcore.jar) to method sun.awt.AppContext.getAppContext() WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Exception in thread "main" java.lang.IllegalArgumentException: Canvas3D: GraphicsConfiguration is not compatible with Canvas3D at javax.media.j3d.Canvas3D.checkForValidGraphicsConfig(Canvas3D.java:945) at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:986) at com.docjava.Main.testGc(Main.java:29) at com.docjava.Main.main(Main.java:13) An inability to construct a Canvas3D is a bit of a show stopper, isn't it? Thanks! - D |
Administrator
|
This post was updated on .
Strictly follow the instructions of the Java3D user's guide I wrote:
https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/ It mentions the necessary JARs. jogamp-fat.jar contains the necessary JARs for JOGL, JOCL, JOAL and GlueGen. Yes, you need to use the JARs of Java3D too, they are mentioned here: https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/#commandline Your source code works with Java 1.8. The JogAmp community isn't responsible for the regressions within AWT in Java 1.9 under OS X. You can still use Java 1.8 in the meantime. Edit.: It would be interesting to know what happens here on your machine: https://github.com/gouessej/java3d-core/blob/master/src/main/java/org/jogamp/java3d/JoglPipeline.java#L8500 Edit.: What happens when you call "new Canvas3D(null)"?
Julien Gouesse | Personal blog | Website
|
In reply to this post by gouessej
I found, through experiment, that jdk1.8.152 has the same problem as jdk1.9. This problem is not easy for me to solve. Anybody have any ideas?
Thanks! - Doug public static void main(String[] args) { testGc(); } private static void testGc() { final GraphicsEnvironment localGraphicsEnvironment = getLocalGraphicsEnvironment(); final GraphicsDevice defaultScreenDevice = localGraphicsEnvironment.getDefaultScreenDevice(); GraphicsConfiguration c[] = defaultScreenDevice .getConfigurations(); for (int i = 0; i < c.length; i++) { System.out.println("gc:" + i + ":" + c[i]); } GraphicsConfiguration gc = c[0]; Canvas3D c3d = new Canvas3D(gc); System.out.println("done"); } /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java -javaagent:/Applications/idea.app/Contents/lib/idea_rt.jar=59078:/Applications/idea.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar:/Users/lyon/current/java/testHello/out/production/testHello:/Users/lyon/current/java/testHello/jars/j3dcore.jar:/Users/lyon/current/java/testHello/jars/j3dutils.jar:/Users/lyon/current/java/testHello/jars/jogamp-fat.jar:/Users/lyon/current/java/testHello/jars/vecmath.jar com.docjava.Main gc:0:CGLGraphicsConfig[dev=1317015680,pixfmt=0] Exception in thread "main" java.lang.IllegalArgumentException: Canvas3D: GraphicsConfiguration is not compatible with Canvas3D at javax.media.j3d.Canvas3D.checkForValidGraphicsConfig(Canvas3D.java:984) at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1025) at com.docjava.Main.testGc(Main.java:35) at com.docjava.Main.main(Main.java:19) Process finished with exit code 1 |
In reply to this post by gouessej
Thanks for your suggesting on Canvas3D. I have tried the following code:
public static void testCanvas3D() { Canvas3D c3d = new Canvas3D(null); } public static void main(String[] args) { testCanvas3D(); } The output is: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java -javaagent:/Applications/idea.app/Contents/lib/idea_rt.jar=59943:/Applications/idea.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar:/Users/lyon/current/java/testHello/out/production/testHello:/Users/lyon/current/java/testHello/jars/j3dcore.jar:/Users/lyon/current/java/testHello/jars/j3dutils.jar:/Users/lyon/current/java/testHello/jars/jogamp-fat.jar:/Users/lyon/current/java/testHello/jars/vecmath.jar com.docjava.Main Exception in thread "main" java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration at javax.media.j3d.Canvas3D.checkForValidGraphicsConfig(Canvas3D.java:982) at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1025) at com.docjava.Main.testCanvas3D(Main.java:19) at com.docjava.Main.main(Main.java:23) I have never attempted to make a new instance of Canvas3D with a null GraphicsConfiguration, before. Not sure what to expect. Thanks! - Doug |
Administrator
|
You have to use the property "allowNullGraphicsConfig" to make it work. Sorry, I forgot that information.
Edit.: -Dj3d.allowNullGraphicsConfig By the way, you're still not using Java3D 1.6.0 Final according to your stack trace. When I look at the source code, one line of your latest stack trace is on a comment in Java3D 1.6.0 Final, it's not possible.
Julien Gouesse | Personal blog | Website
|
In order to remove any worries about the version of the jar file that I am using, I am now building from source code everything except the jogamp-fat.jar.
Also, I have added the -Dj3d.allowNullGraphicsConfig , as suggested (great idea!). The message "Java 3D: null graphics configs disabled" indicated that things are seeing the new flag, but, sadly, there is no joy in Mudville :( Thank you for your kind assistance. Regards, - Doug public static void testCanvas3D() { //-Dj3d.allowNullGraphicsConfig // in order to make the below code work. Canvas3D c3d = new Canvas3D(null); } public static void main(String[] args) { testCanvas3D(); } /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java -Dj3d.allowNullGraphicsConfig -javaagent:/Applications/idea.app/Contents/lib/idea_rt.jar=60718:/Applications/idea.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar:/Users/lyon/current/java/testHello/out/production/testHello:/Users/lyon/current/java/testHello/jars/jogamp-fat.jar com.docjava.Main Java 3D: null graphics configs disabled Exception in thread "main" java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration at javax.media.j3d.Canvas3D.checkForValidGraphicsConfig(Canvas3D.java:982) at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1025) at com.docjava.Main.testCanvas3D(Main.java:19) at com.docjava.Main.main(Main.java:23) Process finished with exit code 1 |
Administrator
|
Which source code do you use?
The line 982 is in a comment in Java3D 1.6.0-final: https://github.com/hharrison/java3d-core/blob/master/src/javax/media/j3d/Canvas3D.java#L982 I advise you to put a debug point on this line: https://github.com/gouessej/java3d-core/blob/master/src/main/java/org/jogamp/java3d/JoglPipeline.java#L8500 If Canvas3D.graphicsConfigTable remains empty, all graphics configurations will be considered invalid. Edit.: Please add -Dj3d.allowNullGraphicsConfig=true.
Julien Gouesse | Personal blog | Website
|
I am using:
https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/#commandline to guide me to: git clone https://github.com/hharrison/java3d-core.git j3d-core git clone https://github.com/hharrison/java3d-utils.git j3d-utils git clone https://github.com/hharrison/vecmath.git vecmath mkdir jogl-v2.3.2 wget http://jogamp.org/deployment/v2.3.2/fat/jogamp-fat.jar -P jogl-v2.3.2 The jogamp-fat.jar is used now, in conjunction with the above j3d-core, j3d-utils and vecmath source codes. I tried putting in: synchronized (Canvas3D.graphicsConfigTable) { System.out.println("Canvas3D.graphicsConfigTable.put"); Canvas3D.graphicsConfigTable.put(config, gcInf0); } but the print statement is never executed. Am I using the correct version of the source code and the correct version of the jogl? Thanks! - Doug |
Administrator
|
You seem to be using the correct version of JOGL and Java3D except if you have forgotten to remove any version of Java3D installed as an extension, this is explained in my tutorial.
Do you use "-Dj3d.allowNullGraphicsConfig=true"? I advise you to use the debug mode in your favourite IDE and to put a debug point into JoglPipeline.getBestConfiguration(GraphicsConfigTemplate3D,GraphicsConfiguration[]) and into Canvas3D.checkForValidGraphicsConfig(GraphicsConfiguration,boolean). Moreover, I advise you to use the reflection API to call the private static method Canvas3D.defaultGraphicsConfiguration(). If it throws an exception or if it returns null, it will explain why all this doesn't work. Either GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() is null in your configuration or GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().getBestConfiguration(GraphicsConfigTemplate) returns null. A dirty workaround would consist in filling the table manually in case of failure. Edit.: GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() isn't null according to your previous tests. Maybe GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(new GraphicsConfigTemplate3D()) is null. I'm not sure that "pixfmt=0" is a good piece of news. What happens with Java 1.8 update < 152 (i.e before the regression)?
Julien Gouesse | Personal blog | Website
|
Thank you for your prompt response.
You may see: "-Dj3d.allowNullGraphicsConfig" in the jvm invocation, /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java -Dj3d.allowNullGraphicsConfig Is that right? You write: "Either GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() is null in your configuration or GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().getBestConfiguration(GraphicsConfigTemplate) returns null" Interestingly, neither assertion is bearing fruit. I shall attempt to print the references prior to the death of jvm so that you may see what I am seeing. First, the code: public static void main(String[] args) { GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd=localGraphicsEnvironment .getDefaultScreenDevice(); System.out.println ("GraphicsDevice" + ":"+gd); GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D(); //is this an OK way to create a template? Should I turn off some antialiasing features? //or assert off-screen rendering? System.out.println ("template" + ":"+template); //Here is where we kill the jvm: gd.getBestConfiguration(template); } I hope I got the template code right....now for the output: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java -Dj3d.allowNullGraphicsConfig -javaagent:/Applications/idea.app/Contents/lib/idea_rt.jar=53454:/Applications/idea.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar:/Users/lyon/current/java/testHello/out/production/testHello:/Users/lyon/current/java/testHello/jars/jogamp-fat.jar com.docjava.Main GraphicsDevice:sun.awt.CGraphicsDevice@4783da3f template:redSize : 2, greenSize : 2, blueSize : 2, depthSize : 16, doubleBuffer : REQUIRED, sceneAntialiasing : UNNECESSARY, stereo : UNNECESSARY Java 3D: null graphics configs disabled java.lang.RuntimeException: Unable to initialize JAWT at com.sun.opengl.impl.JAWT$1.run(JAWT.java:100) at java.security.AccessController.doPrivileged(Native Method) at com.sun.opengl.impl.JAWT.getJAWT(JAWT.java:95) at com.sun.opengl.impl.macosx.MacOSXOnscreenGLDrawable.lockSurface(MacOSXOnscreenGLDrawable.java:144) at com.sun.opengl.impl.macosx.MacOSXOnscreenGLContext.makeCurrentImpl(MacOSXOnscreenGLContext.java:57) at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134) at javax.media.j3d.JoglPipeline$QueryCanvas.doQuery(JoglPipeline.java:9049) at javax.media.j3d.JoglPipeline.getBestConfiguration(JoglPipeline.java:8797) at javax.media.j3d.Renderer.doWork(Renderer.java:514) at javax.media.j3d.J3dThread.run(J3dThread.java:275) DefaultRenderingErrorListener.errorOccurred: GRAPHICS_CONFIG_ERROR: Renderer: Error in GraphicsConfigTemplate3D.getBestConfiguration() graphicsDevice = sun.awt.CGraphicsDevice@4783da3f Process finished with exit code 1 Is this some sort of awt error? Sorry I am feeling really stuck here. Thank you for your help! Regards, - Doug |
In reply to this post by gouessej
I put a main method to test canvas3d, as I think this is the focus of all the attention;
public static void main(String[] args) { GraphicsConfiguration gc= Canvas3D .defaultGraphicsConfiguration(); System.out.println("GraphicsConfiguration:"+gc); } Using jdk9, just to make sure there is no stray jars floating around, the jvm dies pretty quick. I turned VERBOSE=true to get a few more bits of information; Can the pipeline be done in software? I am thinking it would be good to get something to work, even if slowly. Thanks! - Doug /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -javaagent:/Applications/idea.app/Contents/lib/idea_rt.jar=53759:/Applications/idea.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/lyon/current/java/testHello/out/production/testHello:/Users/lyon/current/java/testHello/jars/jogamp-fat.jar javax.media.j3d.Canvas3D 3D @VERSION_BASE@-@VERSION_SUFFIX@-experimental @BUILDTIME_VERBOSE@ Initializing 3D runtime system: version = @VERSION_BASE@-@VERSION_SUFFIX@-experimental @BUILDTIME_VERBOSE@ vendor = @IMPL_VENDOR@ & docjava.com specification.version = 1.6 specification.vendor = @SPEC_VENDOR@ WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (file:/Users/lyon/current/java/testHello/out/production/testHello/) to method sun.awt.AppContext.getAppContext() WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release JoglPipeline.getMaximumLights() 3D system initialized rendering pipeline = JOGL JoglPipeline.getBestConfiguration() # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x000000012e14d0cc, pid=33972, tid=775 # # JRE version: Java(TM) SE Runtime Environment (9.0+11) (build 9.0.1+11) # Java VM: Java HotSpot(TM) 64-Bit Server VM (9.0.1+11, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64) # Problematic frame: # C [libosxapp.dylib+0x20cc] -[NSApplicationAWT sendEvent:]+0x179 # # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/lyon/current/java/testHello/hs_err_pid33972.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Process finished with exit code 134 (interrupted by signal 6: SIGABRT) |
I have a short script for searching for prior java3d versions;
echo $CLASSPATH echo ls /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/ ls /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/ echo ls /Library/Java/Extensions/ ls /Library/Java/Extensions/ echo ls /System/Library/Java/Extensions/ ls /System/Library/Java/Extensions/ echo ls /System/Library/Frameworks/ ls /System/Library/Frameworks/ The output of which appears below. Not sure if this is all the possible places, for a mac, but perhaps it is close. Thanks! - Doug ls /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/ cldrdata.jar localedata.jar sunjce_provider.jar dnsns.jar meta-index sunpkcs11.jar jaccess.jar nashorn.jar zipfs.jar jfxrt.jar sunec.jar ls /Library/Java/Extensions/ ls /System/Library/Java/Extensions/ MRJToolkit.jar ls /System/Library/Frameworks/ AGL.framework ImageCaptureCore.framework AVFoundation.framework ImageIO.framework AVKit.framework InputMethodKit.framework Accelerate.framework InstallerPlugins.framework Accounts.framework InstantMessage.framework AddressBook.framework Intents.framework AppKit.framework JavaFrameEmbedding.framework AppKitScripting.framework JavaScriptCore.framework AppleScriptKit.framework JavaVM.framework AppleScriptObjC.framework Kerberos.framework ApplicationServices.framework Kernel.framework AudioToolbox.framework LDAP.framework AudioUnit.framework LatentSemanticMapping.framework AudioVideoBridging.framework LocalAuthentication.framework Automator.framework MapKit.framework CFNetwork.framework MediaAccessibility.framework CalendarStore.framework MediaLibrary.framework Carbon.framework MediaPlayer.framework CloudKit.framework MediaToolbox.framework Cocoa.framework Message.framework Collaboration.framework Metal.framework Contacts.framework MetalKit.framework ContactsUI.framework ModelIO.framework CoreAudio.framework MultipeerConnectivity.framework CoreAudioKit.framework NetFS.framework CoreBluetooth.framework NetworkExtension.framework CoreData.framework NotificationCenter.framework CoreDisplay.framework OSAKit.framework CoreFoundation.framework OpenAL.framework CoreGraphics.framework OpenCL.framework CoreImage.framework OpenDirectory.framework CoreLocation.framework OpenGL.framework CoreMIDI.framework PCSC.framework CoreMIDIServer.framework Photos.framework CoreMedia.framework PhotosUI.framework CoreMediaIO.framework PreferencePanes.framework CoreServices.framework PubSub.framework CoreTelephony.framework Python.framework CoreText.framework QTKit.framework CoreVideo.framework Quartz.framework CoreWLAN.framework QuartzCore.framework CryptoTokenKit.framework QuickLook.framework DVComponentGlue.framework QuickTime.framework DVDPlayback.framework Ruby.framework DirectoryService.framework SafariServices.framework DiscRecording.framework SceneKit.framework DiscRecordingUI.framework ScreenSaver.framework DiskArbitration.framework Scripting.framework DrawSprocket.framework ScriptingBridge.framework EventKit.framework Security.framework ExceptionHandling.framework SecurityFoundation.framework FWAUserLib.framework SecurityInterface.framework FinderSync.framework ServiceManagement.framework ForceFeedback.framework Social.framework Foundation.framework SpriteKit.framework GLKit.framework StoreKit.framework GLUT.framework SyncServices.framework GSS.framework System.framework GameController.framework SystemConfiguration.framework GameKit.framework TWAIN.framework GameplayKit.framework Tcl.framework Hypervisor.framework Tk.framework ICADevices.framework VideoDecodeAcceleration.framework IMCore.framework VideoToolbox.framework IMServicePlugIn.framework WebKit.framework IOBluetooth.framework module.map IOBluetoothUI.framework vecLib.framework IOKit.framework vmnet.framework IOSurface.framework |
In reply to this post by gouessej
People! Listen to me very carefully.
I know the exact spot where the JVM 9 crashes. In the file j3d/j3d-core/src/javax/media/j3d/GraphicsConfigTemplate3D.java, in the method... @Override public GraphicsConfiguration getBestConfiguration(GraphicsConfiguration[] gc) { if ((gc == null) || (gc.length == 0) || (gc[0] == null)) { return null; } synchronized (globalLock) { testCfg = gc; // It is possible that the followign postRequest will // cause request renderer run immediately before // runMonitor(WAIT). So we need to set // threadWaiting to true. threadWaiting = true; // Prevent deadlock if invoke from Behavior callback since // this thread has to wait Renderer thread to finish but // MC can only handle postRequest and put it in Renderer // queue when free. if (Thread.currentThread() instanceof BehaviorScheduler) { VirtualUniverse.mc.sendRenderMessage(gc[0], this, // this is not executed MasterControl.GETBESTCONFIG); } else { // this is executed VirtualUniverse.mc.postRequest(MasterControl.GETBESTCONFIG, this); } // this is okay runMonitor(J3dThread.WAIT); // !!! this crashes the JVM 9 !!! GraphicsConfiguration graphicsConfiguration = (GraphicsConfiguration) testCfg; // this is okay return graphicsConfiguration; } } |
In reply to this post by Douglas Lyon
Douglas, when you git clone the j3d project and curl the jogl files based on the j3d/j3d-core/README-build.html webpage instructions, you create 4 directories. The j3d directories need to be named like this:
j3d-core j3d-util vecmath The jogl directory is named jogl-v2.3.1 However, the build.xml file in j3d-core directory refers to the jogl-v2.3.2 directory that does not exist initially. This error needs to be corrected to begin compiling your own j3d project. |
In reply to this post by Douglas Lyon
Douglas, I don't understand why you are seeing any errors in the latest Java 8. I am convinced that everything functions well when you use the Java 8. I don't doubt that you are seeing errors in Java 8, but I suspect that it is off-topic to discuss the details of the graphics configuration, canvas, and other things in this special situation. Maybe you are having some kind of general problem in the local build environment such as the "unclean" environment in which the Java has created multiple directories with the different library files or something that looks like we are seeing ghosts.
|
In reply to this post by Douglas Lyon
I forgot to mention once again: I don't expect any errors if you are using Java 8.
The first error of the type: Canvas3D: GraphicsConfiguration is not compatible with Canvas3D or the second error about the null GraphicsConfiguration, are both acceptable. Both errors messages can be created by crafting the convenient code and both of these messages are useless. Eventually, the getBestConfiguration(based_on_this_3D_template) method is called and eventually, you can create 3D objects despite any previous error messages. But you cannot call this method in Java 9. |
In reply to this post by Predrag Bokšić
Thanks, I think there is also an error in the "1.5" directive in
the build.xml, as the javac was asking to create "1.6" versions of the bytecodes (or newer).... Ciao, - D On 12/27/17 12:36 PM, Predrag Bokšić [via jogamp] wrote: > Douglas, when you git clone j3d and jogl projects based on the > j3d/j3d-core/README-build.html webpage instructions, you create 4 > directories. The j3d directories need to be named like this: > j3d-core > j3d-util > vecmath > The jogl directory is named > jogl-v2.3.1 > > However, the build.xml file in j3d-core directory refers to the > jogl-v2.3.2 directory that does not exist initially. This error needs to > be corrected to begin compiling your own j3d project. > > > > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://forum.jogamp.org/Jogl-Jogamp-on-Java-9-tp4038012p4038448.html > To unsubscribe from Jogl/Jogamp on Java 9, click here > < > NAML > <http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > |
In reply to this post by gouessej
Here is how I am able to run java on the mac;
step 1, totally remove jdk9; sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/ sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane step 2, reinstall jdk8 (1.8_151) The jdk9 launcher was somehow preventing the creation of a canvas3d, even when jdk8 was selected as the preferred run-time. I do not know what is going on with that. You may test my webstart version of jogl at: http://www.docjava.com/book/cgij/code/jnlp/j3d.examples.boids.Main.jnlp Please let me know if you have any problems running the program...and if anybody can get jdk9 on a mac to run java3d, I would sure appreciate knowing about it. Thanks! - Doug |
Administrator
|
This post was updated on .
In reply to this post by Douglas Lyon
No, it isn't, you have to use "-Dj3d.allowNullGraphicsConfig=true" otherwise the null graphics configuration remains disabled. Predrag, why does it crash? https://github.com/gouessej/java3d-core/blob/master/src/main/java/org/jogamp/java3d/GraphicsConfigTemplate3D.java#L320 There is no need of "pipeline be done in software", the problem is in the initialization with AWT, JOGL itself isn't to blame. You don't realize the amount of work that would require the implementation of a software pipeline and anyway, as the concern is in AWT, such a pipeline wouldn't help at all. Nobody should use Java Webstart nowadays...
Julien Gouesse | Personal blog | Website
|
The exact line of code where the JVM 9 crashes (on the latest Apple computers) can be found in the file j3d/j3d-core/src/javax/media/j3d/GraphicsConfigTemplate3D.java, in the method GraphicsConfiguration getBestConfiguration(GraphicsConfiguration[] gc). Please read the method contents to find the line inside.
@Override public GraphicsConfiguration getBestConfiguration(GraphicsConfiguration[] gc) { if ((gc == null) || (gc.length == 0) || (gc[0] == null)) { return null; } synchronized (globalLock) { testCfg = gc; // It is possible that the followign postRequest will // cause request renderer run immediately before // runMonitor(WAIT). So we need to set // threadWaiting to true. threadWaiting = true; // Prevent deadlock if invoke from Behavior callback since // this thread has to wait Renderer thread to finish but // MC can only handle postRequest and put it in Renderer // queue when free. if (Thread.currentThread() instanceof BehaviorScheduler) { VirtualUniverse.mc.sendRenderMessage(gc[0], this, // this is not executed MasterControl.GETBESTCONFIG); } else { // this is executed VirtualUniverse.mc.postRequest(MasterControl.GETBESTCONFIG, this); } // this is okay runMonitor(J3dThread.WAIT); // !!! this crashes the JVM 9 !!! GraphicsConfiguration graphicsConfiguration = (GraphicsConfiguration) testCfg; // this is okay return graphicsConfiguration; } } More precisely, the spot where the JVM 9 crashes is in canvas.doQuery(); in @Override GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate3D gct, GraphicsConfiguration[] gc) in the file j3d-core/src/javax/media/j3d/JoglPipeline.java. And even more precisely, the spot where the JVM 9 crashes is in context.destroy(); in the following method: // It seems that at least on Mac OS X we need to do the OpenGL // context-related work outside of the addNotify call because the // Canvas hasn't been resized to a non-zero size by that point private void doQuery() { if (alreadyRan) return; GLContext context = glDrawable.createContext(null); int res = context.makeCurrent(); if (res != GLContext.CONTEXT_NOT_CURRENT) { try { chooser.init(context); } finally { context.release(); } } // !!! this crashes the JVM 9 !!! context.destroy(); alreadyRan = true; glDrawable.setRealized(false); nativeWindow.destroy(); } } in the file JoglPipeline.java. I don't know why this is happening, but I was interested in learning how to examine the program execution. |
Free forum by Nabble | Edit this page |