JDK-6620693 : Change to ProgressSource in JDK 7 causes NoSuchMethodError in new Java Plug-in
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u5
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-10-24
  • Updated: 2010-09-08
  • Resolved: 2008-06-16
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
6u10 b08Fixed
Related Reports
Relates :  
Description
If the new Java Plug-In is run and a JDK 7 build is named in deployment.properties, applets will fail to load with the following exception:

java.lang.NoSuchMethodError: sun.net.ProgressSource.getProgress()I
	at sun.plugin.util.ProgressMonitor.registerSource(ProgressMonitor.java:129)
	at sun.net.ProgressSource.beginTracking(ProgressSource.java:148)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1031)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:397)
	at sun.plugin2.applet.Applet2ClassLoader.getBytes(Applet2ClassLoader.java:361)
	at sun.plugin2.applet.Applet2ClassLoader.access$100(Applet2ClassLoader.java:47)
	at sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:153)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:150)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
	at sun.plugin2.applet.Applet2ClassLoader.loadCode(Applet2ClassLoader.java:695)
	at sun.plugin2.applet.Applet2Manager.createApplet(Applet2Manager.java:2246)
	at sun.plugin2.applet.Applet2Manager.access$1500(Applet2Manager.java:83)
	at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:845)
	at java.lang.Thread.run(Thread.java:675)

This is happening because ProgressSource.getProgress() was changed to return a long instead of an int in JDK 7 in 5052093. Since the new plug-in needs to run on multiple JRE versions, we need to change the code in sun.plugin.util.ProgressMonitor() to call ProgressSource.getProgress() and the ProgressEvent constructor reflectively, or find another solution.

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6620693.0/
31-10-2007

EVALUATION Changed to access ProgressSource and ProgressEvent classes reflectively. This is necessary because the fix for 5052093 in JDK 7 changed signatures of some methods and constructors, and in the context of the new Java Plug-In this code must work on top of both JDK 7 and earlier releases. Tested by running Iris on new Java Plug-In on top of JDK 7 (to diagnose 6623943).
31-10-2007