2
votes

I'm trying to run this Java application (jar) via Java Web Start and am having an incredibly difficult time.

Here's my current JNLP source:

<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="Test.jnlp">
    <information>
        <title>Jnlp Testing</title>
        <vendor>YONG MOOK KIM</vendor>
        <homepage href="http://localhost:8080/" />
        <description>Testing Testing</description>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.6+" />
        <jar href="TestJnlp.jar" />
        <jar href="lib/appframework-1.0.3.jar"/>
        <jar href="lib/junit-4.7.jar"/>
        <jar href="lib/org.eclipse.swt.win32.win32.x86_64_3.100.0.v4233d.jar"/>
        <jar href="lib/org-netbeans-modules-java-j2seproject-copylibstask.jar"/>
        <jar href="lib/sqlite-jdbc-3.7.2.jar"/>
        <jar href="lib/swing-worker-1.1.jar"/>
    </resources>
    <application-desc main-class="proteotypic.ProteotypicQuantificationApp" />
</jnlp>

Upon running the JNLP file, I get the following Error:

JNLPException[category: Launch File Error : Exception: null : LaunchDesc:

---- here the JNLP ----

at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
at com.sun.javaws.Launcher.prepareResources(Unknown Source)
at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I have signed all the jars except lib/org.eclipse.swt.win32.win32.x86_64_3.100.0.v4233d.jar - if I sign that one too, I get a different exception:

com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost:8080/lib/org.eclipse.swt.win32.win32.x86_64_3.100.0.v4233d.jar
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

java.io.IOException: invalid SHA1 signature file digest for org/eclipse/swt/awt/SWT_AWT$4.class
at com.sun.deploy.cache.CacheEntry$9.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

After doing "javaws -viewer" and re-running the JNLP, I get:

https://gist.github.com/3183636

3
Try use javaws -viewer to wipe any trace of your previous attempts. - pmoleri
Thank you. I posted the result above. - sudo
It seems like the first exception, as recursed said you have to sign all the jars with the same singature. Have you sign them signed all before the last attempt? - pmoleri
Try stripping all signatures from all Jars then signing once with the new certificate. - Andrew Thompson
Andrew Thompson and pmoleri - thank you so much. I did exactly what you said and it worked. First, I stripped all the signatures and then reassigned using my own signature! How can I rep you guys? Do you need to "answer" the question? - sudo

3 Answers

2
votes

You have to sign the jar file. You can do this yourself using keytool, but if you plan on deploying this, I would recommend getting it signed by Verisign or a company like it.

If you just need a temporary fix, signing it yourself for testing is fine.

Here is an easy to use tutorial.

2
votes

All jars must be signed with the same signature.

2
votes

All jars in one jnlp need to be signed with the same signature, use an extension with its own jnlp for jars that are signed by third parties.

Some jars use the original signature in the jar for crypto (the JDBC driver for SQL server) others do not work when re-signed (javahelp.jar)

You can also save the trouble signing them by including this in your application's jnlp:

<extension name="javahelp" href="javahelp.jnlp"/>