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

deployment.properties file not correctly taken into account under specific circumstances

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 :
      With the attached JNLP file, WebStart seems to incorrectly relaunch a VM with the result that deployment.javaws.secure.properties line in the deployment.properties file is ignored.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Deploy the attached test case as a signed web start app (sign only the JAR file, not the JNLP file)
      2. On the local machine, add the line
      deployment.javaws.secure.properties=java.locale.providers
      to the system-level or user-level deployment.properties file as described in http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/properties.html
      3. Launch the web start application locally

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The application should complete normally
      ACTUAL -
      The application terminates with an exception.
      Note that the application prints "COMPAT,CLDR", indicating that at the application level the property is correctly set. However, it does not appear to be correctly set when the VM first loads a Locale, hence the incorrect result.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.text.ParseException: Unparseable date: "3/20/15 10:59:00 PM"
      at java.text.DateFormat.parse(java.base@9-ea/DateFormat.java:366)
      at Toto.main(Toto.java:14)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:533)
      at com.sun.javaws.Launcher.executeApplication(jdk.javaws@9-ea/Launcher.java:1736)
      at com.sun.javaws.Launcher.executeMainClass(jdk.javaws@9-ea/Launcher.java:1671)
      at com.sun.javaws.Launcher.doLaunchApp(jdk.javaws@9-ea/Launcher.java:1519)
      at com.sun.javaws.Launcher.run(jdk.javaws@9-ea/Launcher.java:156)
      at java.lang.Thread.run(java.base@9-ea/Thread.java:843)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Toto.java
       =========

       import java.text.*;
       import java.util.*;

       public class Toto {
         private static final String TXT = "3/20/15 10:59:00 PM";

         public static void main(String... argv) throws Exception {
               DateFormat dateformat=
               DateFormat.getDateTimeInstance(DateFormat.SHORT,
                       DateFormat.MEDIUM,
                       Locale.US);
               dateformat.setTimeZone(TimeZone.getTimeZone("GMT"));
               System.out.println(System.getProperty("java.locale.providers"));
               try {
                       Date date = dateformat.parse(TXT);
               } catch(Exception e) {
                       e.printStackTrace(System.err);
               }
         }
       }


       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.8" max-heap-size="512m" java-vm-args="-ea"/>
          <j2se version="1.8+" max-heap-size="512m" java-vm-args="-ea -XaddExports:java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED"/>
            <property name="java.locale.providers" value="COMPAT,CLDR"/>
          </resources>

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

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

      CUSTOMER SUBMITTED WORKAROUND :
      Ensure that the same arguments are specified for the lines j2se version="1.8" and j2se version="1.8+" (not always possible since some arguments are only acceptable for later versions)

            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: