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

WebStart: Jigsaw options should match standalone JRE

XMLWordPrintable

    • x86_64
    • windows_7

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      EA build 175 introduces the --illegal-access option, with "--illegal-access=permit" by default.

      This default does not seem to apply to Web Start apps, leading to compatibility issues. The issue is aggravated by the fact that the option is not recognised by Web Start, and Jigsaw warnings are not printed by Web Start apps.

      Note that two related issues (--illegal-access option not recognised by Web Start; Jigsaw warnings not printed to console) have already been filed, although only one has been attributed a bug ID (JDK-8182697)

      REGRESSION. Last worked in version 9

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

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Set up the small Web Start application as given, with a Deployment Rule Set Rule allowing Run
      2. Enable debugging and tracing in Java Console
      3. Run the application

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Application should run, with the following text printed in the Console

      Testing stderr
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by OpenModuleTest (jar://something.jar/) to field java.util.TreeMap.comparator
      WARNING: Please consider reporting this to the maintainers of OpenModuleTest
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      OK
      ACTUAL -
      The application does not run, with a Jigsaw error

      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 @595661
      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/com.sun.javaws.Launcher.executeApplication(Unknown Source)
      at jdk.javaws@9/com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      at jdk.javaws@9/com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
      at jdk.javaws@9/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 ----------
      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");
           }
      }


      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"/>
            <jar href="test.jar" main="true"/>
          </resources>

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

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

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

              Created:
              Updated:
              Resolved: