changeset 133:c93e44ff65f8

PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path element in the manifest.
author Deepak Bhole <dbhole@redhat.com>
date Wed, 28 Sep 2011 16:06:02 -0400
parents 09c15e374a75
children ef67e5cb533c
files ChangeLog NEWS netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java
diffstat 3 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 05 11:52:15 2011 -0400
+++ b/ChangeLog	Wed Sep 28 16:06:02 2011 -0400
@@ -1,3 +1,10 @@
+2011-09-28  Deepak Bhole <dbhole@redhat.com>
+
+	PR794: IcedTea-Web 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-08-05  Deepak Bhole <dbhole@redhat.com>
 
 	* plugin/icedteanp/java/sun/applet/PluginStreamHandler.java
--- a/NEWS	Fri Aug 05 11:52:15 2011 -0400
+++ b/NEWS	Wed Sep 28 16:06:02 2011 -0400
@@ -11,8 +11,9 @@
 New in release 1.0.5 (2011-XX-XX):
 * Plugin
   - PR749: sun.applet.PluginStreamHandler#handleMessage(String) really slow
-Common
+* Common
   - PR768: Signed applets/Web Start apps don't work with OpenJDK7 and up
+  - PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path element in the manifest
 
 New in release 1.0.4 (2011-07-20):
 * Security updates:
--- a/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java	Fri Aug 05 11:52:15 2011 -0400
+++ b/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java	Wed Sep 28 16:06:02 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 Web Start does not support 
+                // it and the plug-in does not support manifest classpaths in 
+                // icedtea-web 1.0.x
+                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;