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

Jigsaw debug options need to be whitelisted

XMLWordPrintable

    • x86
    • windows_7

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      As proposed by Mark Reinhold
       http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-May/012673.html
      there is a last-minute command-line option available for enabling/disabling/debugging Jigsaw visibility problems.

      This flag --illegal-access=permit/warn/debug/deny needs to be whitelisted on the Web Start side to be passed through to the Java launcher

      REGRESSION. Last worked in version 9

      ADDITIONAL REGRESSION INFORMATION:
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+174)
      Java HotSpot(TM) Server VM (build 9-ea+174, mixed mode, emulated-client)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile the attached file to a JAR file
      2. Sign the jar, add a DeploymentRuleSet rule to allow running
      3. Start the application as a Web Start app

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The application should run, printing warnings to the console
      ACTUAL -
      The application does not run, does not print any warnings

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @9718a5
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
      at java.base/java.lang.reflect.Field.checkCanSetAccessible(Unknown Source)
      at java.base/java.lang.reflect.Field.setAccessible(Unknown Source)
      at OpenModuleTest.main(OpenModuleTest.java:10)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      at jdk.javaws@9-ea/com.sun.javaws.Launcher.executeApplication(Unknown Source)
      at jdk.javaws@9-ea/com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      at jdk.javaws@9-ea/com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
      at jdk.javaws@9-ea/com.sun.javaws.Launcher.run(Unknown Source)
      at java.base/java.lang.Thread.run(Unknown Source)


      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" href="test.jnlp">
          <information>
            <title>Test app</title>
            <vendor>Anon</vendor>
            <offline-allowed/>
          </information>
          <security>
              <all-permissions/>
          </security>
          <update check="always" policy="always" />
          <resources>
            <j2se version="1.9" java-vm-args="--illegal-access=debug"/>
            <jar href="test.jar" main="true"/>
          </resources>

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


      OpenModuleTest.java
      =================

      import java.lang.reflect.Field;
      import java.util.Comparator;
      import java.util.TreeMap;

      public class OpenModuleTest {
           public static void main(String[] args) {
              System.err.println("Testing stderr");
               for (Field field : TreeMap.class.getDeclaredFields()) {
                   if (field.getType() == Comparator.class) {
                       field.setAccessible(true);
                       break;
                   }

               }

               System.out.println("OK");
           }
      }


      ---------- END SOURCE ----------

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

              Created:
              Updated:
              Resolved: