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

Java applet fails to load applet on specific URL due to timing issue with Firefox

XMLWordPrintable

      Java applet fails to load applet on specific URL due to timing issue between Java and JavaScript.

      Steps to Reproduce:

      1) Go to
      https://www.medarbejdersignatur.dk/produkter/nemid_medarbejdersignatur/support/noeglefil/test_signatur_med_noeglefil/
         A page with the heading "UNDERSØGER JAVA" comes up. The body of the page says "Vent venligst..." ("Please wait...").

      2) A dialog asking the user "Do you want to run this application?" pops up.
      Click Run.

      3) A new page with the heading "UNDERSØGER DIN COMPUTER" is displayed. The
      text "Henter og starter NemID CSP-softwaren..." is also displayed.

      4) After a few seconds' delay the page is supposed to forward to the login page
      (https://www.medarbejdersignatur.dk/produkter/nemid_medarbejdersignatur/#log_paa_selvbetjening, but that never happens due to the fact that the isActive property on the Enroll Applet is undefined at this point, and is never
      defined, in the JavaScript DOM's applet object.

         To see this, open the Firefox JavaScript debugger (press F12), find the file
      https://www.medarbejdersignatur.dk/check-signature-scripts/check-csp-head.js.html,and set a breakpoint in the method onLoadingTimer() on the line that says
      "if (enroll.isActive == undefined)". Try pressing F8 to continue a handful of
      times, and observe that enroll.isActive stays undefined even after the Java
      console says that start() has been called, and hence after isActive SHOULD be
      defined.

         Since the onLoadingTimer() method is called from the main page,
      index.html, using the following snippet of code, enroll.isActive should
      return "true" at SOME point, it should not stay "undefined" indefinitely:

              $(document).ready(function() {
                  window.setTimeout(onLoadingTimer, 100);
              });

          Also, if "100" in the above code snippet is changed to "5000" on our test
      machine, enroll.isActive IS defined, and the applet loads correctly, so this
      seems to be a timing issue somewhere.

          Finally, it has also been observed that waiting a few seconds before
      checking whether enroll.isActive is defined in the debugger, it WILL be
      defined. We suspect the delay allows the JVM to call start() on the applet,
      and that this defines isActive.

          Note also that this is a Firefox-only issue. The URL works correctly in
      Internet Explorer 11.

      java version "1.8.0_75"
      Java(TM) SE Runtime Environment (build 1.8.0_75-b10)
      Java HotSpot(TM) Client VM (build 25.75-b10, mixed mode)

      Does this problem occur on J2SE 7ux, 8ux? Yes / No (be specific version#)

      The problem occurs on J2SE 1.8.0u75b10 and J2SE 1.8.0u76b04 but NOT 1.8.0u73
      (current production version).

      Operating System Configuration Information (be specific):
      Windows 7 or Windows 10, both fully updated.
      Standard install of Firefox 45.0 and J2SE.

      Hardware Configuration Information (be specific):
      Virtual machine, so hardware configuration is not available.

        1. image001.png
          image001.png
          10 kB
        2. image004.png
          image004.png
          2 kB
        3. image005.png
          image005.png
          2 kB

            alitvinov Anton Litvinov (Inactive)
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: