United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4674761 : Plug-in and Netscape both freeze after a modal dialog is launched from JavaScrip

Details
Type:
Bug
Submit Date:
2002-04-25
Status:
Closed
Updated Date:
2003-08-15
Project Name:
JDK
Resolved Date:
2002-10-15
Component:
deploy
OS:
windows_2000
Sub-Component:
plugin
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.1_05 (05)

Related Reports
Backport:

Sub Tasks

Description

Name: gm110360			Date: 04/25/2002


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


FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Wersja 5.00.2195]

ADDITIONAL OPERATING SYSTEMS :
Windows 98
Windows 98 SE


EXTRA RELEVANT SYSTEM CONFIGURATION :
Netscape 6, version 6.2
Mozilla, build 2002041711

A DESCRIPTION OF THE PROBLEM :
Basically speaking, bug identical to 4506751 (which regards
Java Plugin for Internet Explorer and was fixed) cause
lock-up problem in Java Plugin for Netscape.
The problem is that the browser and plug-in become locked-up
after a modal dialog is shown when invoked via JavaScript.
I have been able to reproduce this problem with Java Plug-in
1.3.0, 1.3.1, and 1.4.0.  As the most simple scenario,
imagine an HTML document with an Applet and a form with a
button that has a JavaScript method that is called when the
button is pressed.
The onPressed event calls a JavaScript method that gets the
Applet and then makes a call into a method that brings up a
modal dialog.  This modal dialog can be a Swing Dialog such
as JOptionPane or a custom dialog. It does not matter.
I think bug is in one of npjava*.dll.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Identical to ones listed in report for bug 4506751.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: Dialog shown should get input from user.
Actual: Dialog shows and browser freezes.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
None - JVM hangs.

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
HTML page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>
HTML Test Page
</title>
</head>
<body>
AppletTest will appear below in a Java enabled browser.<br>
<applet
  codebase = "."
  code     = "AppletTest.class"
  name     = "TestApplet"
  width    = "400"
  height   = "300"
  hspace   = "0"
  vspace   = "0"
  align    = "middle"
  scriptable = true
  mayscript = true
>
</applet>
<INPUT VALUE="J" TYPE="button"
onClick="document.applets[0].showJOption();alert('after')">
</body>
</html>

Java applet:
import java.awt.*;
import java.io.*;
import javax.swing.*;

public class AppletTest extends JApplet {

  public AppletTest() {
  }

  public void init() {
    super.init();
  }

  public void showJOption() {
    System.out.println("showJ enter");

    Frame f = (Frame)SwingUtilities.getRoot(this);
 
JOptionPane.showMessageDialog(f,"Message","Title",JOptionPane.INFORMATION_MESSAGE);

    System.out.println("showJ exit");
  }
}

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

CUSTOMER WORKAROUND :
None found.
(Review ID: 145817) 
======================================================================

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
1.4.1_05
mantis

FIXED IN:
1.4.1_05
mantis

INTEGRATED IN:
1.4.1_05
mantis
mantis-b04

VERIFIED IN:
1.4.1_05


                                     
2004-06-14
EVALUATION

When Java method called from JavaScript pops up a modal dialog box, java plug-in wants to disable the browser window, at the same time browser is waiting for the java method to complete and hence we have a deadlock situation. This problem can be fixed by not completely blocking while making the java calls from javascript.
This will be fixed as part of 4516042
###@###.### 2002-04-25

This bug is fixed for IE as part of 4516042, we need to provide similar fix for netscape
###@###.### 2002-05-10

Confirmed in NS 7.

###@###.### 2002-07-31

The solution:

Having javascript to java call executing on new java thread, and having the calling thread continues to dispatch message.


###@###.### 2002-09-11
                                     
2002-07-31



Hardware and Software, Engineered to Work Together