JDK-6603034 : Regression: AppletViewer throws NPE with jdk 6u4 b03 latest nightly build
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u3
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-09-11
  • Updated: 2010-09-08
  • Resolved: 2007-09-12
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.
6u4 b03Fixed
Install latest jdk 6u4 b03 nightly build, run appletviewer on any demo applet and you'll see the following NPE.
This problem is applicable to all platforms.

D:\testclasses>"F:\Program Files\Java\jdk1.6.0_04\bin"\appletviewer "F:\ProgramFiles\Java\jdk1.6.0_04\demo\applets\Clock\example1.html"
Exception in thread "main" java.lang.NullPointerException
        at sun.applet.AppletPanel.init(AppletPanel.java:213)
        at sun.applet.AppletViewer.<init>(AppletViewer.java:177)
        at sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.jav
        at sun.applet.AppletViewer.parse(AppletViewer.java:1122)
        at sun.applet.AppletViewer.parse(AppletViewer.java:1056)
        at sun.applet.Main.run(Main.java:138)
        at sun.applet.Main.main(Main.java:80)

EVALUATION This is caused by the fix for 6574554. The problem is due to the loader is null in the AppletPanel.init. To fix the problem, we create the loader in AppletPanel.init and in AppletPanel.createAppletThread, we create the loader only if it is null. This problem is not applicable to running applets in a browser because the loader is created before the AppletPanel.init is called.