JDK-4910772 : JOptionPane.showInternalMessageDialog causes JVM lock
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2003-08-21
  • Updated: 2006-03-18
  • Resolved: 2006-03-18
Related Reports
Duplicate :  
Description
Name: rmT116609			Date: 08/21/2003


FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

AND

java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)

AND

java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)


FULL OS VERSION :
Linux linux801 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux

Also locks Windows 2000

EXTRA RELEVANT SYSTEM CONFIGURATION :
all (tested) configurations

A DESCRIPTION OF THE PROBLEM :
When using JApplet on Netscape, modal dialogs can fall "behind" the browser window.  For this reason, I am trying to use showInternalXDialog in JOptionPane, passing the contentPane of the JApplet as the parent component.

THis works fine, and a JInternalFrame is shown to the user, HOWEVER, if the user attempts to navigate off the applet page whilst the modal internal frame is visible, the JVM (and the browser) lock up...

This occurs on both Linux and Windows, Netscape 6, IE 5, IE 5.5, and IE 6

(I haven't been able to test on Mac, or other browsers)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile this class, and view the applet using the attatched HTML.  Click the button so that the internal message box becomes visible, then try to navigate to another page (whilst it is still visible)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would have expected the JVM to exit normally, and stop the applet...
ACTUAL -
JVM locks, browser locks, browser will not close, or navigate

ERROR MESSAGES/STACK TRACES THAT OCCUR :
None...

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
-------------JAVA CODE--------------

/**
 * <p>Title: JInternal Frame JVM Crash Example</p>
 * <p>Description: Shows how JVM can lock when JApplet showing JInternalFrame</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: Paterson Institute for Cancer Research</p>
 * @author Tim Yates
 * @version 1.0
 */

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;

public class CrashApplet extends JApplet
{
  JButton jButton1 = new JButton();
  public void init()
  {
    try
    {
      jbInit();
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  private void jbInit() throws Exception
  {
    jButton1.setText("Launch Modal Internal Frame");
    jButton1.addActionListener(new java.awt.event.ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        jButton1_actionPerformed(e);
      }
    });
    this.getContentPane().add(jButton1,  BorderLayout.NORTH);
  }

  void jButton1_actionPerformed(ActionEvent e)
  {
    JOptionPane.showInternalMessageDialog( this.getContentPane(), "Now try to navigate to another page...  JVM will lock" );
  }
}

----------------HTML----------------

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ASCII">
<title>
Crash Test
</title>
</head>
<body>
CrashApplet will appear below in a Java enabled browser.<br>
<applet
  codebase = "."
  code     = "CrashApplet.class"
  name     = "CrashApplet"
  width    = "600"
  height   = "400"
  hspace   = "0"
  vspace   = "0"
  align    = "middle"
>
</applet>
</body>
</html>

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None that I can think of...
(Incident Review ID: 188582) 
======================================================================

Comments
EVALUATION will fix this bug when fixing applet lifecycle as a whole
17-03-2006

EVALUATION There is race condition during applet destroy sequences.
19-08-2005

EVALUATION It doesn't cause a crash. It causes a hang. The modality code for JOptionPane has been changed so I will need to test with this new code. ###@###.### 2003-12-04 Not reproducible on build 1.6.0-ea-b47 on Firefox 1.0.6 on Linux JDS 2. It is reproducible on Windows on build 1.6.0-ea-b47 on IE6. There is no indication of any Swing problem. It looks like it may be a plugin bug. Assigning to plugin for further evaluation.
24-09-2004