Mac JDK 7 signing Jars

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

Mac JDK 7 signing Jars

Traksewt
Hi, I'm battling getting a simple J3D demo working. I believe it is issues with jar signing. I get the error:

basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 141816 us, pluginInit dt 4104943 us, TotalTime: 4246759 us
 started!
java.lang.UnsatisfiedLinkError: no J3D in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
        at java.lang.Runtime.loadLibrary0(Runtime.java:845)
        at java.lang.System.loadLibrary(System.java:1084)
        at javax.media.j3d.MasterControl$22.run(MasterControl.java:891)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:888)
        at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:233)
        at test.J3DApplet.init(J3DApplet.java:32)
        at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:722)
Ignored exception: java.lang.UnsatisfiedLinkError: no J3D in java.library.path
basic: Dialog type is not candidate for embedding
security: Reset deny session certificate store

Java Plug-in 10.9.2.05
Using JRE version 1.7.0_09-b05 Java HotSpot(TM) 64-Bit Server VM

I've copied all the jars from gluegen, jogl & Java3D into the one location.
 
My applet looks like:

<object
      width="600" height="400">
   <param name="code" value="org.jdesktop.applet.util.JNLPAppletLauncher">
   <param name="archive" value="jar/applet-launcher.jar,
                                jar/gluegen-rt.jar,
                                jar/jogl-all.jar,
                                jar/testj3d.jar,
                                            jar/vecmath.jar,
                  jar/j3dcore-pre5.jar,
                    jar/j3dutils.jar">
                               
   <param name="codebase_lookup" value="false">
   <param name="subapplet.classname" value="test.J3DApplet">
   <param name="subapplet.displayname" value="JOGL Test Java3D">
   <param name="noddraw.check" value="true">
   <param name="progressbar" value="true">
   <param name="jnlpNumExtensions" value="1">
   <param name="jnlpExtension1" value="http://localhost/test/jogl-all-awt.jnlp">
   <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
   <param name="jnlp_href" value="testj3d.jnlp">
   <comment>
     <embed code="org.jdesktop.applet.util.JNLPAppletLauncher"
          width="600" height="400"
          type="application/x-java-applet;version=1.6"
          pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
          archive="jar/applet-launcher.jar,
    jar/gluegen-rt.jar,
                   jar/jogl-all.jar,
                   jar/testj3d.jar,
                   jar/vecmath.jar,
                   jar/j3dcore-pre5.jar,
                   jar/j3dutils.jar"
          codebase_lookup="false"
          subapplet.classname="test.J3DApplet"
          subapplet.displayname" value="JOGL Test Java3D"
          noddraw.check" value="true"
          progressbar="true"
          jnlpNumExtensions="1"
          jnlpExtension1="http://localhost/test/jogl-all-awt.jnlp"
          java_arguments="-Dsun.java2d.noddraw=true"
          jnlp_href="testj3d.jnlp">
        <noembed>Sorry, no Java support detected.</noembed>
     </embed>
   </comment>
</object>

My testj3d.jnlp looks like:
<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="http://localhost/test" href="testj3d.jnlp">
  <information>
    <title>JOGL JNLP Java3D test</title>
    <vendor>O'Donoghue Lab</vendor>
    <homepage href="http://odonoghuelab.org/"/>
    <description>test j3d</description>
    <description kind="short">Kennys Test</description>
    <offline-allowed/>
  </information>

    <resources>
      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+"/>
      <property name="sun.java2d.noddraw" value="true"/>
      <jar href="jar/vecmath.jar" />
      <jar href="jar/j3dutils.jar" />
      <jar href="jar/j3dcore-pre5.jar" />
      <jar href="jar/testj3d.jar" main="true"/>
      <extension name="jogl" href="http://localhost/test/jogl-all-awt.jnlp"/>
   </resources>

  <applet-desc
      name="Test Java3D"
      main-class="test.J3DApplet"
      width="640"
      height="480">
  </applet-desc>
</jnlp>



I wrote a little script to help with signing all the jars. I used SHA-256 because otherwise it was giving an error saying it was corrupt when I was trying to verify it using jarsigner.

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256  gluegen-rt.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 jogl-all.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 jogl-all-natives-windows-i586.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 gluegen-rt-natives-windows-amd64.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 jogl-all-natives-windows-amd64.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 gluegen-rt-natives-linux-i586.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 jogl-all-natives-linux-i586.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 gluegen-rt-natives-linux-amd64.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 jogl-all-natives-linux-amd64.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 gluegen-rt-natives-macosx-universal.jar ww
jarsigner -keystore testKeys  -storepass $1 -digestalg SHA-256 jogl-all-natives-macosx-universal.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 j3dcore-pre5.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 j3dutils.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 vecmath.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 testj3d.jar ww
jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 jogl-demos.jar ww

jarsigner -keystore testKeys -storepass $1 -digestalg SHA-256 applet-launcher.jar ww
javaws -Xclearcache

---------
thanks in advance for any pointers
Kenny
Reply | Threaded
Open this post in threaded view
|

Re: Mac JDK 7 signing Jars

Traksewt
btw, I'm on Mountain Lion. It would be great if there was a Java3D applet demo to download, similar to the other demos. I appreciate the work you are all doing keeping Java3D alive, so I'm happy with any help I can get.
Reply | Threaded
Open this post in threaded view
|

Re: Mac JDK 7 signing Jars

gouessej
Administrator
In reply to this post by Traksewt
Hi

It doesn't find your own classes.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mac JDK 7 signing Jars

Traksewt
Thanks for replying Julien,

I didn't understand what you meant by finding my own classes as it did get into my applet code OK. I realised that it was picking up a legacy j3dcore, which is why it was trying to load a native lib in J3D. I had renamed the j3dcore (and other) jars in /System/Library/Java/Extensions to j3dcore.jar.old, but it appears that it was still getting read. Once I deleted them, I then  progressed to the crashing applet/console similar to:
http://forum.jogamp.org/Java3D-applet-tests-on-Mac-OS-X-10-7-5-td4027164.html

I added the OffscreenLayerOption fix by interactiveMesh (http://forum.jogamp.org/Issue-with-Java-3D-under-OpenJDK-7-Mac-OS-X-tp4025259p4027375.html), and now I can see the applet running in a popup window.

thanks again all.