JDK-6335114 : NPE in GrayBoxPainter when applet fails to load
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 5.0u3
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-10-11
  • Updated: 2014-02-27
  • Resolved: 2006-01-07
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.
Other
5.0u7 b01Fixed
Description
This bug occurs in FireFox 1.0.4 plus Java 1.5.0_05.  It also happens on Mac OS X using Java 1.5.0 Update 3 DP 2 -- it's a bug in GrayBoxPainter.

1. Make sure the Java console is turned on.
2. Go to http://webphysics.davidson.edu/WebTalks/AAPT_Den_Wkshp/moja.html
3. This web site has a badly formed applet (class not found.)  That error is correctly reported, but you'll also get this backtrace:

Exception in thread "Thread-4" java.lang.NullPointerException
	at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
	at sun.plugin.AppletViewer.showAppletException(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
	at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
	at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-colors.class" java.lang.NullPointerException
	at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
	at sun.plugin.AppletViewer.showAppletException(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Comments
EVALUATION Fix for 6205422 was integrated into mustang and backport to 5.0u4. The fix for mustang is good, while the backport added a line(GrayBoxPainter.java:153) to method showLoadingError() as the following: GrayBoxPainter.java 148 public void showLoadingError() 149 { 150 appletErrorOccurred = true; 151 152 // stop the Animation so you can show the error 153 m_grayboxPanel.stop(); 154 155 // Repaint graybox because state if changed. 156 repaintGrayBox(); 157 } 158 Line 153 will throw a NPE when m_grayboxPanel is null(sometimes it will be null) .
18-10-2005

SUGGESTED FIX Add 'null' check at line GrayBoxPainter.java:153.
18-10-2005

WORK AROUND No workaround, other than making sure your applet is correctly written.
11-10-2005