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

Cannot enable debugging on JNLP applet with java-vm-args params

    Details

    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      b83
    • CPU:
      x86_64
    • OS:
      windows_7
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_60"
        Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
        Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        When the Java plugin is given runtime parameters to enable debugging, the plugin hangs and eventually dies if the applet is launched via JNLP, and contains any java-vm-args parameters.

        REGRESSION. Last worked in version 8u51

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        In the 32 bit 8u60 control panel, provide the following runtime parameters:

        -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n

        Compile the test applet code, place the resulting classes into "TestApplet.jar", and then add the directory containing the jar to the trusted site list. Click on the HTML file to launch the applet.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The applet should run, and display "Applet loaded"
        ACTUAL -
        The VM hangs for a while, and eventually dies.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        -- TestApplet.java --

        import java.awt.CardLayout;

        import javax.swing.JApplet;
        import javax.swing.JLabel;
        import javax.swing.JPanel;
        import javax.swing.SwingUtilities;

        public class TestApplet extends JApplet {
            public TestApplet() {
                super();
            }

            private static final String BANNER = "Banner";

            public void init() {

                try {
                    //Execute a job on the event-dispatching thread; creating this applet's GUI.
                    SwingUtilities.invokeAndWait(new Runnable() {
                        public void run() {
                            JLabel label = new JLabel();
                            label.setText("Applet loaded.");

                            JPanel banner = new JPanel();
                            banner.add(label);

                            getContentPane().add(banner);
                        }
                    });
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }


        -- TestApplet.html --
        <html>
            <body>
                <object type="application/x-java-applet" id="testapplet" height="100%" width="100%">
                    <param name="jnlp_href" value="TestApplet.jnlp">
                    The test applet failed to run. Be certain that Java is installed.
                </object>
            </body>
        </html>


        -- TestApplet.jnlp --
        <?xml version="1.0" encoding="UTF-8"?>
        <jnlp spec="1.0+" href="TestApplet.jnlp">
            <information>
                <title>Test Applet</title>
            </information>
            <resources>
                <j2se version="1.8+" java-vm-args="-Xmx512m"/>
                <jar href="TestApplet.jar" main="true"/>
            </resources>
            <applet-desc
                name="Test Applet"
                main-class="TestApplet"
                width="800"
                height="600">
            </applet-desc>
        </jnlp>
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Either do not set the runtime parameters to enable debugging, or remove the "java-vm-args" attribute from the JNLP file.

          Attachments

          1. 8u51.log
            12 kB
          2. 8u60.log
            58 kB
          3. 8u60.trace
            17 kB
          4. TestApplet.html
            0.3 kB
          5. TestApplet.jar
            1 kB
          6. TestApplet.java
            0.9 kB
          7. TestApplet.jnlp
            0.4 kB

            Issue Links

              Activity

                People

                • Assignee:
                  dtitov Daniil Titov
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: