Java3D applet tests on Mac OS X 10.7.5

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Java3D applet tests on Mac OS X 10.7.5

adamsam
This post was updated on .
Hello there,

I would like to share problems I experienced with Java3D on Mac OS X 10.7.5. I have done plenty of tests trying to run Java applets that make use of Java3D from this page http://www.duling.us/kevin/Java3D/simple/First.html. I am pretty sure no other than intended libraries were being loaded (the only ones on my HD were residing in ~/Library/Java/Extensions/ and CLASSPATH environment variable was not set).

1) With Apple Java for OS X (Java SE 1.6.0_37) installed I got this exception:

java.lang.reflect.InvocationTargetException
        at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:116)
        at sun.plugin2.applet.Plugin2Manager.runOnEDT(Plugin2Manager.java:3541)
        at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3072)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
        at java.lang.Thread.run(Thread.java:680)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.javax.media.j3d)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
        at java.security.AccessController.checkPermission(AccessController.java:549)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
        at sun.plugin2.applet.Applet2SecurityManager.checkPackageAccess(Applet2SecurityManager.java:287)
        at java.lang.ClassLoader$1.run(ClassLoader.java:330)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:328)
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.newInstance0(Class.java:326)
        at java.lang.Class.newInstance(Class.java:308)
        at sun.plugin2.applet.Plugin2Manager$13.run(Plugin2Manager.java:3060)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:702)
        at java.awt.EventQueue.access$400(EventQueue.java:82)
        at java.awt.EventQueue$2.run(EventQueue.java:663)
        at java.awt.EventQueue$2.run(EventQueue.java:661)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:672)
        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)
Exception: java.lang.reflect.InvocationTargetException

This exception was occurring with Java3D 1.6.0-pre3* + JOGL from 2.0-rc08 to 2.0-rc11 or latest automatic build of JOGL 2.0 (b857 was tested) with GlueGen 2.0 (b608 was tested) or http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z . Also Java3D 1.6.0-pre1/1.5.2/1.5.1/1.5.0 + JOGL 1.1.1a with GlueGen 1.0b6 did the same as would probably do other combinations.


2) With Oracle JRE 7 (Java SE 7 Update 09) installed I got one of these exceptions:

java.lang.NoClassDefFoundError: Could not initialize class javax.media.j3d.VirtualUniverse (happened always after applet reload or page refresh no matter what combination of Java3D + JOGL was used)
java.lang.NoClassDefFoundError: javax/media/nativewindow/CapabilitiesImmutable (Java3D 1.5.0/1.6.0-pre3* + JOGL 2.0-rc11/-rc08)
java.lang.NoClassDefFoundError: javax/media/opengl/GLException (Java3D 1.6.0-pre1/1.5.2 + JOGL 2.0-rc11/-rc08)
java.lang.NoClassDefFoundError: javax/media/opengl/GLCapabilitiesChooser (Java3D 1.5.2/1.5.1 + JOGL 2.0-rc11)
java.lang.NoClassDefFoundError: javax/media/opengl/GLDrawable (Java3D 1.5.0/1.6.0-pre1 + JOGL 2.0-rc11/-rc08)
java.lang.NoClassDefFoundError: javax/media/opengl/GL (Java3D 1.5.0/1.6.0-pre3* + JOGL 2.0-rc11/-rc08)
java.lang.NoClassDefFoundError: javax/media/opengl/AbstractGraphicsDevice (Java3D 1.6.0-pre1/1.5.2/1.5.1/1.5.0 + jogamp-all-platforms.7z/JOGL 2.0-b857 with GlueGen 2.0-b608)

These were occurring quite at random but to some extent depending on which combination of Java3D + JOGL was used (as decribed in parenthesis, but this is not exhaustive list of combinations in which they occurred).

The only combinations that didn't throw an exception were:
• Java3D 1.6.0-pre3* + latest automatic builds of JOGL 2.0 (b857 and b853 were tested) with GlueGen 2.0 (b608 and b605 were tested) or http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z but instead the whole applet crashed (blinked and disappeared) right away the Java splash screen was shown.
• Java3D Java3D 1.6.0-pre1/1.5.2/1.5.1/1.5.0 + JOGL 1.1.1a with GlueGen 1.0b6 but instead the applet lagged at Java splash screen and driven CPU usage towards 100% which could indicate that deadlock was happening (maybe related to messed QueryCanvas as discussed here: http://forum.jogamp.org/NCDF-problem-with-VirtualUniverse-td4027031.html)


I can only confirm that JOGL examples from http://jogamp.org/deployment/jogamp-next/jogl-test-applets.html which use .jar files hosted at http://jogamp.org/deployment/jogamp-next/jar/ (jogamp-next is currently alias for v2.0-rc11) are working fine on OS X 10.7.5 (Safari, Firefox and Opera) with Apple JRE 6 and Oracle JRE 7 too.

---
* the Java3D 1.6.0-pre3 I am referring to is @hharrison's fork from this github.
Reply | Threaded
Open this post in threaded view
|

Re: Java3D applet tests on Mac OS X 10.7.5

gouessej
Administrator
adamsam wrote
I am pretty sure no other than intended libraries were being loaded (the only ones on my HD were residing in ~/Library/Java/Extensions/ and CLASSPATH environment variable was not set).
Just don't use an OS dependent environment variable, keep in mind that Java3D might be installed as an extension on Mac, don't install Java3D as an extension and just set the classpath by the "Java" cross-platform way with -cp or -classpath when compiling and running Java3D applications.

The deadlock problem has been recently solved by Harvey but the fix might be still only in a separate JAR.

I fear that Mac users who already have Java3D installed as an extension will have some problems, maybe this old version (1.5) is used instead of Java3D 1.6.0. If that's the case, it will be a real problem for applets and Java Web Start.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Java3D applet tests on Mac OS X 10.7.5

vorth
Apple always used to ship a very old Java3d in /System/Library/Java/Extensions.  I was never able to use any other version of Java3d unless I set that one aside.
Reply | Threaded
Open this post in threaded view
|

Re: Java3D applet tests on Mac OS X 10.7.5

gouessej
Administrator
vorth wrote
Apple always used to ship a very old Java3d in /System/Library/Java/Extensions.  I was never able to use any other version of Java3d unless I set that one aside.
That's exactly what I meant, thanks.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Java3D applet tests on Mac OS X 10.7.5

adamsam
This post was updated on .
In reply to this post by gouessej
gouessej wrote
Just don't use an OS dependent environment variable, keep in mind that Java3D might be installed as an extension on Mac, don't install Java3D as an extension and just set the classpath by the "Java" cross-platform way with -cp or -classpath when compiling and running Java3D applications.
As an applet developer I would rather rely on Java plug-in with JNLP or JNLPAppletLauncher or other method of supplying correct libraries, but I was just testing applets from http://www.duling.us/kevin/Java3D/Troubleshooting.html and http://www.java3d.org/howto.html so I was not able to set -cp or -classpath when running them, neither I compiled them.

What do you mean by installing Java3D as an extension? Putting it to one of the .../Library/Java/Extensions/ folders on Mac or installing them through Java plug-in wizard on a web page containing Java applet that uses JNLP file (as in http://jogamp.org/deployment/jogamp-next/jogl-applet-version.html)? How can I remove extensions installed by this wizard?

As I said I had no other Java3D or JOGL libraries present on my HD than those in ~/Library/Java/Extensions/. There is only a possibility that some libraries were extracted from some other .jar during the applet run. I also checked Java applet process and files that it was currently using and no other Java3D and JOGL library files were opened by this process. Here is a complete list of files used by the process:
/
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libjli.jnilib
/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
/Users/adamsamec/Library/Java/Extensions/gluegen-rt-natives-macosx-universal.jar
/System/Library/PrivateFrameworks/JavaLaunching.framework/Versions/A/JavaLaunching
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libserver.dylib
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libjvmlinkage.dylib
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libverify.dylib
/System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libjava.jnilib
/System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaRuntimeSupport.framework/Versions/A/JavaRuntimeSupport
/private/var/folders/64/1rz111nj3lb_p4492d63gm2w0000gn/T/hsperfdata_adamsamec/11592
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libzip.jnilib
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
/System/Library/Java/Support/CoreDeploy.bundle/Contents/Resources/Java/deploy.jar
/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/javaws.jar
/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/plugin.jar
/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Versions/A/JavaApplicationLauncher
/System/Library/Java/Support/CoreDeploy.bundle/Contents/Resources/Java/libdeploy.jnilib
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libnet.jnilib
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libnio.jnilib
/usr/share/icu/icudt46l.dat
/Users/adamsamec/Library/Java/Extensions/j3dcore.jar
/Users/adamsamec/Library/Java/Extensions/j3dutils.jar
/Users/adamsamec/Library/Java/Extensions/jogl-all-natives-macosx-universal.jar
/Users/adamsamec/Library/Java/Extensions/vecmath.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libawt.jnilib
/System/Library/ColorSync/Profiles/sRGB Profile.icc
/System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat
/System/Library/Caches/com.apple.IntlDataCache.le.kbdx
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightDemiBold.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libjawt.dylib
/private/var/folders/64/1rz111nj3lb_p4492d63gm2w0000gn/C/com.apple.LaunchServices-034501.csstore
/System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/Resources/SArtFile.bin
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightDemiItalic.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightItalic.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightRegular.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaTypewriterBold.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaSansDemiBold.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaTypewriterRegular.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaSansRegular.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libfontmanager.jnilib
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/Extras2.rsrc
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libj2pkcs11.jnilib
/usr/libexec/SmartCardServices/pkcs11/tokendPKCS11.so
/private/var/db/mds/system/mdsDirectory.db
/private/var/db/mds/messages/se_SecurityMessages
/System/Library/Fonts/LucidaGrande.ttc
/usr/lib/dyld
/private/var/db/dyld/dyld_shared_cache_x86_64
->0xffffff80246e63f0
->0xffffff8015fa1f40
->0xffffff80246e7050
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
/System/Library/Java/Support/CoreDeploy.bundle/Contents/Resources/Java/deploy.jar
/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/javaws.jar
/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/plugin.jar
count=1, state=0x2
/Users/adamsamec/Library/Java/Extensions/gluegen-rt-natives-macosx-universal.jar
/dev/null
/Users/adamsamec/Library/Java/Extensions/j3dcore.jar
/Users/adamsamec/Library/Java/Extensions/j3dutils.jar
/Users/adamsamec/Library/Java/Extensions/jogl-all-natives-macosx-universal.jar
/Users/adamsamec/Library/Java/Extensions/vecmath.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar
/dev/random
/dev/urandom
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar
->0xffffff8013db30c8
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/Extras2.rsrc
->0xffffff8013cff640
localhost:54647->localhost:54646
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightRegular.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaSansRegular.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaTypewriterBold.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightDemiItalic.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaTypewriterRegular.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaSansDemiBold.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightItalic.ttf
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/fonts/LucidaBrightDemiBold.ttf

vorth wrote
Apple always used to ship a very old Java3d in /System/Library/Java/Extensions.  I was never able to use any other version of Java3d unless I set that one aside.
I have removed everything from all */Library/Java/Extensions folders and kept only the tested libraries.
Reply | Threaded
Open this post in threaded view
|

Re: Java3D applet tests on Mac OS X 10.7.5

gouessej
Administrator
adamsam wrote
gouessej wrote
Just don't use an OS dependent environment variable, keep in mind that Java3D might be installed as an extension on Mac, don't install Java3D as an extension and just set the classpath by the "Java" cross-platform way with -cp or -classpath when compiling and running Java3D applications.
As an applet developer I would rather rely on Java plug-in with JNLP or JNLPAppletLauncher or other method of supplying correct libraries, but I was just testing applets from http://www.duling.us/kevin/Java3D/Troubleshooting.html and http://www.java3d.org/howto.html so I was not able to set -cp or -classpath when running them, neither I compiled them.

What do you mean by installing Java3D as an extension? Putting it to one of the .../Library/Java/Extensions/ folders on Mac or installing them through Java plug-in wizard on a web page containing Java applet that uses JNLP file (as in http://jogamp.org/deployment/jogamp-next/jogl-applet-version.html)? How can I remove extensions installed by this wizard?

As I said I had no other Java3D or JOGL libraries present on my HD than those in ~/Library/Java/Extensions/. There is only a possibility that some libraries were extracted from some other .jar during the applet run. I also checked Java applet process and files that it was currently using and no other Java3D and JOGL library files were opened by this process.
In this case you probably got the old version of Java3D by running an applet using it and you have to clean Java Web Start cache to fix the conflict (even though it is quite annoying, we should not have to do so) with:
javaws -Xclearcache
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Java3D applet tests on Mac OS X 10.7.5

gouessej
Administrator
In reply to this post by adamsam
These are completely outdated instructions. We have no control on these websites.
Julien Gouesse | Personal blog | Website