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

Multiple applets making liveconnect calls hang Internet Explorer

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b04
    • CPU:
      x86
    • OS:
      windows_2000
    • Verification:
      Verified

      Description

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      The tests were performed in IE6.

      A DESCRIPTION OF THE PROBLEM :
      If I load two applets, both of which use live connect to call into JavaScript, into a single instance of Internet Explorer, the browser locks up.

      This problem does not occur in 1.4.1_06 / 1.4.2_03. A separate Live Connect bug (bug id 5077565) in more recent versions of the 1.4.1 and 1.4.2 VMs (which have been fixed in 1.5) prevented any further testing.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Wait for the page to load.
      2. Press the Send Message Loop 1 button.
      3. Press the Send Message Loop 2 button.
      4. Within a few seconds the browser will hang.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The applets make the callbacks into JavaScript without hanging the browser.
      ACTUAL -
      The browser hangs.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Java code:

      import java.applet.Applet;

      import netscape.javascript.JSObject;

      public class MessagingApplet extends Applet
      {
          private final static String APPLET_ID_PARAMETER = "applet.id";
          private String appletId = null;

          public void start()
          {
      appletId = getParameter(APPLET_ID_PARAMETER);
          }
          
          public void sendMessages(int numberToSend)
          {
      System.out.println("SendMessage called for " + appletId);
      for (int i = 0; i < numberToSend; ++i)
      {
      System.out.println("About to call MessageReceiver (\"" + appletId + "\", " + i + ")");
      JSObject.getWindow(MessagingApplet.this).call("MessageReceiver", new Object[] { appletId, new Integer(i) });
      System.out.println("Called MessageReceiver (\"" + appletId + "\", " + i + ")");
      }
      System.out.println("SendMessage finished for " + appletId);
          }
      }



      HTML code:

      <html>

      <head>
      <title>Sun 1.5 multiple applet hang test</title>

      <script language="JavaScript">
      function SendMessage(l_sAppletName)
      {
      document.getElementById(l_sAppletName).sendMessages(10);
      }

      function StartMessageLoop(l_sAppletName)
      {
      SendMessage(l_sAppletName);

      setTimeout("StartMessageLoop('" + l_sAppletName + "')", 250);
      }

      function MessageReceiver(sAppletName, nCount)
      {
      // do nothing
      }
      </script>
      </head>

      <body>

      <table id="tblAppletContainer" border="0">
      <tr>
      <td colspan="2">Wait for the page to load, then press either of the Send Message buttons. Both of these appear to work, and
      output data to the Java console. Press the Start Message Loop 1 button, then press the Start Message Loop 2 button, and
      within a few seconds the browser will hang if the applets are running within the 1.5.0 VM.</td> </tr> <tr>
      <td>
      <applet name="appTest1" id="appTest1" mayscript height="30" width="30" codebase="." code="MessagingApplet.class">
      <param name="applet.id" value="appTest1">
      </applet>
      </td>
      <td>
      <input type="button" value="Send Message 1" onclick="SendMessage('appTest1')">
      &nbsp;&nbsp;&nbsp;
      <input type="button" value="Start Message Loop 1" onclick="StartMessageLoop('appTest1')">
      </td>
      </tr>
      <tr>
      <td>
      <applet name="appTest1" id="appTest2" mayscript height="30" width="30" codebase="." code="MessagingApplet.class">
      <param name="applet.id" value="appTest2">
      </applet>
      </td>
      <td>
      <input type="button" value="Send Message 2" onclick="SendMessage('appTest2')">
      &nbsp;&nbsp;&nbsp;
      <input type="button" value="Start Message Loop 2" onclick="StartMessageLoop('appTest2')">
      </td>
      </tr>
      </table>

      </body>

      </html>

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

      CUSTOMER SUBMITTED WORKAROUND :
      None found, since we must be able support multiple applets within the same instance of IE.
      ###@###.### 10/28/04 18:33 GMT

        Attachments

          Activity

            People

            Assignee:
            ccheung Calvin Cheung
            Reporter:
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: