JDK-6753380 : lazy package and parts does not work in jnlp applets with new plugin
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-09-26
  • Updated: 2010-09-08
  • Resolved: 2009-01-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u12 b01Fixed
Description
testcase:  http://javaweb.sfbay.sun.com/~ngthomas/lazypart/testJNLPApplet.html

source:  http://javaweb.sfbay.sun.com/~ngthomas/lazypart/testApplet.java

a simple applet that calls into a method in draw package (draw.drawFoo.hello())

draw.jar is listed in a component-ext jnlp file, with the package tag.

    <jar href="draw.jar" part="draw" download="lazy"/>
<package name="draw.*" part="draw"/>

when you load the applet, exception is thrown:

Hello World testApplet!
basic: JNLP2ClassLoader.findClass: draw.drawfoo: try again ..
basic: Removed progress listener: null
Exception in thread "thread applet-testApplet-1" java.lang.NoClassDefFoundError: draw/drawfoo
	at testApplet.init(testApplet.java:26)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: draw.drawfoo
	at sun.plugin2.applet.Plugin2ClassLoader$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
	at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 3 more


but if you remove the "package" tag line from the jnlp file, it works.

draw.jar contains a bunch of classes, including:
  402 Thu Sep 18 15:15:56 PDT 2008 draw/drawfoo.class

Comments
EVALUATION JNLP2ClassLoader store lazy package parts in a list. There is a bug when compare the requested jar with the contents in the list. It compares Object which is not the same even the two object describe the same jar.
21-10-2008

WORK AROUND remove the "package" tag line from the jnlp file
26-09-2008