JDK-6603340 : Plugin2: Unwanted exceptions getting thrown once page is refreshed and switched back or forward
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2007-09-11
  • Updated: 2010-04-04
  • Resolved: 2007-10-31
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
6u10Resolved
Related Reports
Duplicate :  
Relates :  
Description
Scenario I:
Load the following applet inside the browser and try to refresh the browser
http://sqeweb.sfbay.sun.com/deployment2/jitu/deployment_JDK7_int_ws/deployment/src/plugin/manual/html/ThreadLeak.html
If following exceptions are getting raised then bug is reproduced:
java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at sun.plugin2.message.Queue.waitForMessage(Queue.java:86)
    at sun.plugin2.message.Pipe.receive(Pipe.java:103)
    at sun.plugin2.main.client.MessagePassingExecutionContext.getProxyList(MessagePassingExecutionContext.java:130)
    at sun.plugin2.main.client.PluginProxySelector.select(PluginProxySelector.java:66)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:742)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:672)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:997)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:391)
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Applet2ClassLoader.java:348)
    at sun.plugin2.applet.Applet2ClassLoader.access$100(Applet2ClassLoader.java:47)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:151)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:148)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
    at sqe.ThreadLeakTest.destroy(ThreadLeakTest.java:93)
    at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:834)
    at java.lang.Thread.run(Thread.java:644)
java.lang.RuntimeException: java.lang.NullPointerException
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:962)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2110)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:400)
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Applet2ClassLoader.java:348)
    at sun.plugin2.applet.Applet2ClassLoader.access$100(Applet2ClassLoader.java:47)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:151)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:148)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
    at sqe.ThreadLeakTest.destroy(ThreadLeakTest.java:93)
    at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:834)
    at java.lang.Thread.run(Thread.java:644)
Caused by: java.lang.NullPointerException
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:742)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:672)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:997)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:391)
    ... 11 more
java.lang.reflect.InvocationTargetException
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:116)
    at sun.plugin2.applet.Applet2Manager.runOnEDT(Applet2Manager.java:2308)
    at sun.plugin2.applet.Applet2Manager.access$2500(Applet2Manager.java:82)
    at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:838)
    at java.lang.Thread.run(Thread.java:644)
Caused by: java.lang.NullPointerException
    at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable$4.run(Applet2Manager.java:840)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:217)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:610)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:276)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)


Scenario II:
Load the following applet inside the browser
http://sqeweb.sfbay.sun.com/deployment2/jitu/deployment_JDK7_int_ws/deployment/src/plugin/manual/html/InfiniteLoopTest.html

Following exception is getting thrown on page switching or on refreshing the browser
java.lang.NullPointerException
    at sun.awt.SunToolkit.postEvent(SunToolkit.java:615)
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:110)
    at sun.plugin2.applet.Applet2Manager.runOnEDT(Applet2Manager.java:2308)
    at sun.plugin2.applet.Applet2Manager.setupGrayBoxPainter(Applet2Manager.java:1185)
    at sun.plugin2.applet.Applet2Manager.access$900(Applet2Manager.java:82)
    at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:692)
    at java.lang.Thread.run(Thread.java:644)
exception
Exception in thread "thread applet-InfiniteLoopTest.class-3" java.lang.NullPointerException
    at sun.awt.SunToolkit.postEvent(SunToolkit.java:615)
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:110)
    at sun.plugin2.applet.Applet2Manager.runOnEDT(Applet2Manager.java:2308)
    at sun.plugin2.applet.Applet2Manager.access$2500(Applet2Manager.java:82)
    at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Applet2Manager.java:866)
    at java.lang.Thread.run(Thread.java:644)

Comments
EVALUATION This bug is being marked as a duplicate of 6622332 for bookkeeping purposes and does not need to be re-verified independently. In the case of a regression please file a new bug.
31-10-2007

EVALUATION The fixes for 6603561 caused the exceptions in this bug report to not be thrown any more, but there were still areas in the code where better error checking and robustness was desirable. Returned empty proxy list instead of null in case of error. Fixed a couple of places where the applet parent container could spontaneously become null. Added null pointer check in Applet2Manager.runOnEDT(). Fixed potential NullPointerException in processing of SetAppletSizeMessage in PluginMain on client side. Changed code calling PluginMain.mainLoop() to use try / finally to forcibly tear down JVM in case of unexpected exception on client's main thread which would otherwise currently result in a browser hang.
15-09-2007

SUGGESTED FIX http://analemma.sfbay.sun.com/net/jano2/export2/hotspot/users/kbr/webrevs/mjre/6603340_unwanted_exceptions_and_robustness/
15-09-2007