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

Can't debug web start apps launched from signed JNLP file

XMLWordPrintable

    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+124)
      Java HotSpot(TM) Client VM (build 9-ea+124, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Certain configurations of JNLP file cause an unnecessary JVM relaunch which leads to problems with debugging since there are simultaneously two JVMs trying to access the same debug port.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Deploy a minimal web start application as a signed JAR + JNLP file. Note: it is important to ensure that the JNLP file is signed as per https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/signed_jnlp.html
      2. On the local computer, open the Java control panel and add the debug parameters -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
      to the Runtime Parameters section of the JDK 9 (Desktop Settings->User->Runtime Parameters)
      3. Launch the web start application

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The application should start
      ACTUAL -
      The application does not start and gives an error:
      ERROR: transport error 202: bind failed: Address already in use
      ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
      JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:730]

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.Exception: ERROR: transport error 202: bind failed: Address already in use
      ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
      JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:730]

      at com.sun.javaws.Launcher.relaunch(jdk.javaws@9-ea/Launcher.java:914)
      at com.sun.javaws.Launcher.prepareResources(jdk.javaws@9-ea/Launcher.java:1349)
      at com.sun.javaws.Launcher.prepareAllResources(jdk.javaws@9-ea/Launcher.java:585)
      at sun.plugin2.main.WebStart.prepareToLaunch(jdk.plugin@9-ea/WebStart.java:277)
      at sun.plugin2.main.WebStart.prepareToLaunch(jdk.plugin@9-ea/WebStart.java:261)
      at sun.plugin2.main.WebStart.launchApp(jdk.plugin@9-ea/WebStart.java:223)
      at sun.plugin2.main.WebStart.launchApp(jdk.plugin@9-ea/WebStart.java:194)
      at sun.plugin2.main.WebStart.continueInSecureThread(jdk.plugin@9-ea/WebStart.java:138)
      at sun.plugin2.main.WebStart.access$000(jdk.plugin@9-ea/WebStart.java:48)
      at sun.plugin2.main.WebStart$1.run(jdk.plugin@9-ea/WebStart.java:71)
      at java.lang.Thread.run(java.base@9-ea/Thread.java:843)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      test.jnlp
      ========

      <?xml version="1.0" encoding="utf-8"?>
       <jnlp spec="6.0+" codebase="http://www.example.com/webstart/test" href="test.jnlp">
         <information>
           <title>Test app</title>
           <vendor>Anon</vendor>
           <offline-allowed/>
         </information>
         <security>
             <all-permissions/>
         </security>
         <update check="always" policy="always" />
         <resources>
           <jar href="test.jar" main="true"/>
           <j2se version="1.6+" java-vm-args="-addmods java.se.ee"/>
         </resources>

         <application-desc main-class="Toto"/>
       </jnlp>


      Toto.java
      ========

      public class Toto {
        public static void main(String... argv) throws Exception {
          System.out.println("Success");
        }
      }
      ---------- END SOURCE ----------

            herrick Andy Herrick (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: