« A Boost of Stupidity | Main | Fly Zoom At Your Own Risk »

Eclipse and Java Web Start

Ever had one of those days where the universe is adamant that your problem will not be solved?

If you want such a day, try and get an Eclipse RCP application to deploy via Java Web Start.

If you would like to know all the reasons why your attempt to get this working will fail, read on.

Java Web Start is a feature built into Sun's Java runtime environment, and allows end users to launch Java applications by clicking on a link on a webpage. We desperately need a replacement for our rickity application deployment, and Java Web Start is bang on.

Eclipse seems to come to the party with a special launcher capable of being cranked up using Java Web Start. Sounds promising, until you try to use it.

java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at org.eclipse.equinox.launcher.WebStartMain.basicRun(WebStartMain.java:77)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.WebStartMain.main(WebStartMain.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1205)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1151)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:998)
at com.sun.javaws.Launcher.run(Launcher.java:105)
at java.lang.Thread.run(Unknown Source)

The cause is this quality piece of code. Notice the unhandled error condition:

String fwkURL = searchFor(framework, null);
if (fwkURL == null) {
//MESSAGE CAN"T FIND THE FWK
}
allBundles.remove(framework);
System.getProperties().put(PROP_FRAMEWORK, fwkURL);

Google finds lots of people asking about the problem. Nobody yet has posted a solution.

Of course the solution is to find this bug and fix it, but Eclipse won't let you get away with that without a fight.

Java Web Start has a strong security model. In order for the application to be allowed any kind of meaningful access to the disk or network, the code needs to be signed by a trusted code signing certificate. Responsible stuff. If it worked.

The guys at Eclipse have included corrupted digital signatures in their released jars in Eclipse v3.3. The error you get is this:

java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

The guys at Sun have stepped in to ensure failure by forgetting to include functionality into the jarsigner tool to either replace or remove a signature.

So even if you could find a solution to the Java Web Start NullPointerException, you wouldn't get that far because the lack of signed jars would sink you long before that.

For a project that has such a strong pedigree, this amounts to some seriously bumbling on the part of the Eclipse guys. Codesigning is a big deal: for a major release to be shipped with broken signatures, and for those broken signatures to remain unfixed in subsequent point releases amounts to a serious failure of oversight.

If you want to get this to work, make sure some of these bugs get fixed:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=213715
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213698
https://bugs.eclipse.org/bugs/show_bug.cgi?id=169691
http://forum.java.sun.com/thread.jspa?threadID=5140289&tstart=615

TrackBack

TrackBack URL for this entry:
https://blog.pier29.net/mt/mt-tb.cgi/1860

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)