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

java applet does not start sometimes when it is dynamically inject into the web page

    Details

    • Subcomponent:
    • Introduced In Version:
      7u4
    • Resolved In Build:
      b55
    • CPU:
      x86
    • OS:
      windows_7

      Backports

        Description

        FULL PRODUCT VERSION :
        Java7u4

        ADDITIONAL OS VERSION INFORMATION :
        Windows 7 32Bit ver6.1.7600

        A DESCRIPTION OF THE PROBLEM :
        I use javascript to create html applet tag, then append to html DOM.

        The first append is worked,but it will fail on append more than twice.

        Sometimes applet seems not repaint.

        Sometimes JVM will run the second instance.

        REGRESSION. Last worked in version 7

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        step 1:Write a simple applet.

        step 2:White a javascript function to create applet tag and append to html DOM.

        step 3:Run the javascript function many times.

        step 4:You will see some applet will not worded or JVM will run the second instance.

        step 5:Fix the bug please.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Applets will run at the same ClassLoader and each applet is running normal.
        ACTUAL -
        Situation 1:Applet will not repaint, seems applet dead.
        Situation 2:Applet running at the different JVM.

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

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        Applet Code:
        public class MyApplet extends JApplet {

        public MyApplet() {
        super();
        }

        public void init() {
        this.setSize(300, 300);
        }
        }


        HTML Code:
        <body style="margin:0px;padding:0px;">
        <input type="button" value="createApplet" onclick="createApplet();">
        <script>
        var count = 0;
        function createApplet(){
          var div=document.createElement("div");
          var s = "<applet mayscript='true' code='MyApplet.class' width='50px' height='50px' name='MyApplet"+count+"' id='MyApplet"+count+"' alt='Java Runtime Environment is not working on your system' codebase='' archive='MyApplet.jar'><"+"/applet>";
          div.innerHTML = s;
          document.body.appendChild(div);
          count++;
        }
        </script>
        </body>
        ---------- END SOURCE ----------
        Please indicate when the regression was introduced. If it's a recent regression - please update the release notes.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ccheung Calvin Cheung
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: