Login  Register

Java3D 1.6 Web Start from Mac OS X to Multi OS

Posted by bjoern on May 01, 2017; 10:20pm
URL: https://forum.jogamp.org/Java3D-1-6-Web-Start-from-Mac-OS-X-to-Multi-OS-tp4037924.html

Hi all!

I have serious problems getting our applications on web start running. I am using J3D 1.6 rc11 successfully for a longer time already for our standalone applications, just using self-executable jars - runs perfectly! Thanks again for all your brilliant work!

But now our current major app, the MembraneEditor, requires newly-signed web start jars, and I want to take this chance to completely move away from the old Sun stuff (and give also full access to the Mac world ;-)

However, big problem, it does not work.

I was following Julien's tutorial:

https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/

I am using:

j3dcore.jar
j3dutils.jar
vecmath.jar
jogamp-fat.jar


of the 1.6 final release. In addition I have to say, I first used - instead of jogamp-fat.jar - a couple of separate files with the same result:

jogl-all.jar
gluegen-rt-natives-android-armv6.jar
gluegen-rt-natives-linux-amd64.jar
gluegen-rt-natives-linux-armv6.jar
gluegen-rt-natives-linux-armv6hf.jar
gluegen-rt-natives-linux-i586.jar
gluegen-rt-natives-macosx-universal.jar
gluegen-rt-natives-solaris-amd64.jar
gluegen-rt-natives-solaris-i586.jar
gluegen-rt-natives-windows-amd64.jar
gluegen-rt-natives-windows-i586.jar
jogl-all-natives-android-armv6.jar
jogl-all-natives-linux-amd64.jar
jogl-all-natives-linux-armv6.jar
jogl-all-natives-linux-armv6hf.jar
jogl-all-natives-linux-i586.jar
jogl-all-natives-macosx-universal.jar
jogl-all-natives-solaris-amd64.jar
jogl-all-natives-solaris-i586.jar
jogl-all-natives-windows-amd64.jar
jogl-all-natives-windows-i586.jar
gluegen-rt.jar
gluegen.jar
joal.jar


But if I understood Julien's blog correctly, this is a waste of time unless you are planning to work and update separate libraries here. So I just use now jogamp-fat.jar

Then, I found a couple of useful forum entries, and my jnlp contains, e.g.:

        <security>
                <all-permissions />
        </security>
       
        <property name="sun.java2d.noddraw" value="true"/>
        <property name="sun.java2d.d3d" value="false"/>
        <property name="sun.java2d.opengl" value="false"/> 
        <property name="j3d.rend" value="jogl"/>


... as well as the link to all jar files as <resources> entries.

I modified all jar files and they contain now in the MANIFEST.MF the entries

Permissions: all-permissions
Caller-Allowable-Codebase: *
Codebase: *


They are all signed with my actual software signing certificate.
The Web Start application downloads without any warnings or errors.
The installation process is correctly starting, but then the following happens:



Java Web Start 11.131.2.11 x86_64
Using JRE version 1.8.0_131-b11 Java HotSpot(TM) 64-Bit Server VM
User home directory = /Users/bjsommer
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
CacheEntry[https://www.CELLmicrocosmos.org/cm2/startCm2.jnlp]: updateAvailable=true,lastModified=Mon May 01 22:34:28 CEST 2017,length=2321
CELLmicrocosmos MembraneEditor Version 2.2.2_1


[Parameters]
-filepath of an existing membrane
[Options]
-help       |  starts the program's user manual
-reset      |  start with default settings    
-system_L&F |  use the platform Look & Feel    
                                               
Memory Check:  max. 1908932608 bytes for Java heap space reserved
                                               
                                               
please wait .... Done!
this.mifile_pdbtm /Users/bjsommer/Cm2/cm2settings/pdbtm.mif
JNLPClassLoader: Finding library libjava.dylib
JNLPClassLoader: Finding library liblibGLESv3.so.3.dylib
JNLPClassLoader: Finding library liblibGLESv3.so.dylib
JNLPClassLoader: Finding library libGLESv3.dylib
JNLPClassLoader: Finding library libGLES30.dylib
JNLPClassLoader: Finding library liblibGLESv3.dylib
JNLPClassLoader: Finding library liblibGLES30.dylib
JNLPClassLoader: Finding library liblibGLESv2.so.2.dylib
JNLPClassLoader: Finding library liblibGLESv2.so.dylib
JNLPClassLoader: Finding library libGLESv2.dylib
JNLPClassLoader: Finding library libGLES20.dylib
JNLPClassLoader: Finding library libGLESv2_CM.dylib
JNLPClassLoader: Finding library liblibGLESv2.dylib
JNLPClassLoader: Finding library liblibGLESv2_CM.dylib
JNLPClassLoader: Finding library liblibGLES20.dylib
JNLPClassLoader: Finding library liblibEGL.so.1.dylib
JNLPClassLoader: Finding library liblibEGL.so.dylib
JNLPClassLoader: Finding library libEGL.dylib
JNLPClassLoader: Finding library liblibEGL.dylib
JNLPClassLoader: Finding library liblibGLESv1_CM.so.2.dylib
JNLPClassLoader: Finding library liblibGLESv1_CM.so.dylib
JNLPClassLoader: Finding library libGLESv1_CM.dylib
JNLPClassLoader: Finding library libGLES_CM.dylib
JNLPClassLoader: Finding library libGLES_CL.dylib
JNLPClassLoader: Finding library liblibGLESv1_CM.dylib
JNLPClassLoader: Finding library liblibGLES_CM.dylib
JNLPClassLoader: Finding library liblibGLES_CL.dylib
JNLPClassLoader: Finding library liblibEGL.so.1.dylib
JNLPClassLoader: Finding library liblibEGL.so.dylib
JNLPClassLoader: Finding library libEGL.dylib
JNLPClassLoader: Finding library liblibEGL.dylib
JNLPClassLoader: Finding library liblibEGL.so.1.dylib
JNLPClassLoader: Finding library liblibEGL.so.dylib
JNLPClassLoader: Finding library libEGL.dylib
JNLPClassLoader: Finding library liblibEGL.dylib
M3D 1
java.lang.NullPointerException
        at java.awt.Window.addToWindowList(Window.java:2824)
        at java.awt.Window.init(Window.java:489)
        at java.awt.Window.<init>(Window.java:436)
        at java.awt.Frame.<init>(Frame.java:446)
        at java.awt.Frame.<init>(Frame.java:404)
        at javax.media.j3d.JoglPipeline.getBestConfiguration(JoglPipeline.java:8370)
        at javax.media.j3d.Renderer.doWork(Renderer.java:496)
        at javax.media.j3d.J3dThread.run(J3dThread.java:271)
Exception in thread "Thread-16" java.lang.NullPointerException
        at org.cellmicrocosmos.cm2.functionality3d.Membrane3D.<init>(Unknown Source)
        at org.cellmicrocosmos.cm2.gui.elements.MembraneView.<init>(Unknown Source)
        at org.cellmicrocosmos.cm2.engine.Engine.<init>(Unknown Source)
        at org.cellmicrocosmos.cm2.engine.StartMain$1.run(Unknown Source)



A similar problem had Andreas before:
http://forum.jogamp.org/Jogl-in-a-webstart-application-td4029613.html

But his problem was solved by taking the hints above into account and by updating to a new Jogamp version. I am using now the newest version of Jogamp and Java3D (and before, I was using rc11 with the same effect), but I do not get rid of this error.

The problem is occurring here in my code:

...
GraphicsConfiguration config = null;
...
config = SimpleUniverse.getPreferredConfiguration();
...
membraneUniverseCanvas = new Canvas3D(config)
...




The error is somewhere around the JOGLPipeline occuring; line 8370 is:

GraphicsDevice device = gc[0].getDevice();
        AbstractGraphicsScreen screen = (device != null) ? AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT) :
            AWTGraphicsScreen.createDefault();

     // Create a Frame and dummy GLCanvas to perform eager pixel format selection

        // Note that we loop in similar fashion to the NativePipeline's
        // native code in the situation where we need to disable certain
        // capabilities which aren't required
        boolean tryAgain = true;
        CapabilitiesCapturer capturer = null;
        AWTGraphicsConfiguration awtConfig = null;
        while (tryAgain) {
            Frame f = new Frame(device.getDefaultConfiguration());



So, maybe I am blind and I forget an important step in between, but otherwise I seem to have a serious AWT problem?! Or what am I doing wrong?

My second concrete question in this context is: Can I just use these libraries for all OS?

j3dcore.jar
j3dutils.jar
vecmath.jar
jogamp-fat.jar


I know that it works for self-exectuable jars, but does it also work for Web Start or do I have to optimize the JNLP file for every OS? I was spying at http://www.sweethome3d.com - there are different Java3D versions for Win/Linux/Mac. But for most people it would be much better if you can use only one file for all OS, and I think, this is what the developers had in mind here.

If you want to have a look to the not-functioning app, here you can find it:
https://www.CELLmicrocosmos.org/cm2/startCm2.jnlp

Thanks for any hint and best, Bjorn