United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6620693 Change to ProgressSource in JDK 7 causes NoSuchMethodError in new Java Plug-in
6620693 : Change to ProgressSource in JDK 7 causes NoSuchMethodError in new Java Plug-in

Details
Type:
Bug
Submit Date:
2007-10-24
Status:
Closed
Updated Date:
2010-09-08
Project Name:
JDK
Resolved Date:
2008-06-16
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u5
Fixed Versions:
6u10

Related Reports
Relates:

Sub Tasks

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
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).
                                     
2007-10-31
SUGGESTED FIX

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



Hardware and Software, Engineered to Work Together