# HG changeset patch # User Deepak Bhole # Date 1317328851 14400 # Node ID a31e65674d377906b71f9d427b8fc11f03e0bb40 # Parent 3f75d74db864a5b044771f458b7c07e6f15f7050 PR794: javaws does not work if a Web Start app jar has a Class-Path element in the manifest. diff -r 3f75d74db864 -r a31e65674d37 ChangeLog --- a/ChangeLog Thu Jul 21 15:13:04 2011 +0100 +++ b/ChangeLog Thu Sep 29 16:40:51 2011 -0400 @@ -1,3 +1,10 @@ +2011-09-29 Deepak Bhole + + PR794: javaws does not work if a Web Start app jar has a Class-Path + element in the manifest. + * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java + (retrieve): Blank out the Class-Path elements in manifest. + 2011-07-21 Andrew John Hughes * NEWS: Prepare for 1.8.10. diff -r 3f75d74db864 -r a31e65674d37 NEWS --- a/NEWS Thu Jul 21 15:13:04 2011 +0100 +++ b/NEWS Thu Sep 29 16:40:51 2011 -0400 @@ -10,6 +10,9 @@ New in release 1.8.10 (2011-XX-XX): +* NetX + - PR794: javaws does not work if a Web Start app jar has a Class-Path element in the manifest + New in release 1.8.9 (2011-07-20): * Security fixes diff -r 3f75d74db864 -r a31e65674d37 netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java --- a/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java Thu Jul 21 15:13:04 2011 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java Thu Sep 29 16:40:51 2011 -0400 @@ -94,7 +94,24 @@ if (UrlUtils.isLocalFile(localUrl)) { // if it is known to us, just return the cached file - return new JarFile(localUrl.getPath()); + JarFile returnFile = new JarFile(localUrl.getPath()); + + try { + + // Blank out the class-path because: + // 1) Web Start does not support it + // 2) For the plug-in, we want to cache files from class-path so we do it manually + returnFile.getManifest().getMainAttributes().putValue("Class-Path", ""); + + if (JNLPRuntime.isDebug()) { + System.err.println("Class-Path attribute cleared for " + returnFile.getName()); + } + + } catch (NullPointerException npe) { + // Discard NPE here. Maybe there was no manifest, maybe there were no attributes, etc. + } + + return returnFile; } else { // throw new IllegalStateException("a non-local file in cache"); return null;