JDK-8134495 : Cannot enable debugging on JNLP applet with java-vm-args params
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-08-24
  • Updated: 2017-12-12
  • Resolved: 2015-09-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u72Fixed 9 b83Fixed
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.


Comments
Verified in 8u72 b02
26-10-2015

This seems a regression as reproducible with JRE 8u60 (32-bit) and 9 ea b78 (32-bit). Steps to reproduce: ================ 1. Compile the TestApplet code (TestApplet.java) 2. Create a jar file (TestApplet.jar) containing class files from the compiled code 3. Add the directory containing the jar to trusted site list (Java Control Panel -> Security). 4. Add runtime parameters against the tested JRE version(Java Control Panel -> Java): -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n 5. Click on HTML file (TestApplet.html) to launch the applet. Result: ========= 8u51: OK 8u60: FAIL 9 ea b78: FAIL With JRE 8u51 (32-bit) the applet loads fine with and without debugging parameters. With JRE 8u60 and 9 ea b78, the applet apparently failed to load with VM hanging for a while and eventually die as reported. The applet loads fine with all JRE versions without debugging parameters though. Files attached (Including logs and trace files): =================================== TestApplet.java TestApplet.jnlp TestApplet.jar Testapplet.html 8u51.log 8u60.log 8u60.trace
26-08-2015