Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4145088

NullPointer exception when finalizer is run on applet and system.exit is called

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2.2
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description

      If an applet sets runFinalizersOnExit to true, and later calles System.exit(0) then they will recive a null pointer exception.

      Exception occurred during event dispatching:
      java.lang.NullPointerException: NullPointerException
              at sun.awt.motif.MComponentPeer.pReshape(Native Method)
              at sun.awt.motif.MComponentPeer.setBounds(Compiled Code)
              at java.awt.Component.reshape(Compiled Code)
              at java.awt.Component.setBounds(Compiled Code)
              at java.awt.BorderLayout.layoutContainer(Compiled Code)
              at java.awt.Container.layout(Compiled Code)
              at java.awt.Container.doLayout(Compiled Code)
              at java.awt.Container.validateTree(Compiled Code)
              at java.awt.Container.validate(Compiled Code)
              at java.awt.Window.dispatchEventImpl(Compiled Code)
              at java.awt.Component.dispatchEvent(Compiled Code)
              at java.awt.EventQueue.dispatchEvent(Compiled Code)
              at java.awt.EventDispatchThread.run(Compiled Code)

      Found in JDK1.2beta4-H
      Only occurs in Applets, does not occur in Applications
      This only occurs on Solaris. It does not occur on Win NT, Win 95.
      The user must have java.lang.Runtime "exitVM" permission.


      The applet finalizertest.java is:
      import java.applet.*;
      import java.awt.*;

      public class finalizertest extends Applet {

      public void start() {
              Runtime.getRuntime().runFinalizersOnExit(true);
              System.exit(0);
              }
      }

      The html file finalizertest.html is:
      <title>Finalizer Test</title>
      <applet code = "finalizertest.class" width=400 height=400>
      </applet>

      The permission file exitPermission.jp is:
      grant {
              permission java.lang.RuntimePermission "exitVM";
      };

      The command line is:
      appletviewer -J-Djava.security.policy=exitPermission.jp finalizertest.html

        Attachments

          Activity

            People

            Assignee:
            xdengsunw Xianfa Deng (Inactive)
            Reporter:
            ejucevicsunw Edward Jucevic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: