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

Problems sun.lang.ClassLoader.allowArraySyntax=true not supprted by Webstart

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 6
    • deploy
    • x86
    • windows_xp

    Description

      FULL PRODUCT VERSION :
      JRE version 1.6.0_07 Java HotSpot(TM) Client VM

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Java Web Start 1.6.0_07

      A DESCRIPTION OF THE PROBLEM :
      We use Java Web Start and -Dsun.lang.ClassLoader.allowArraySyntax=true(This property is needed to woraround for the bug 6434149 for JAVA 1.6 ) as it won't work without it.
      The local client version of the application works perfectly with the property set to true as a JAVA option.
      This "sun.lang.ClassLoader.allowArraySyntax" property doesn't belong to the list of secure properties that can be passed into a Webstart application using the java-vm-args attribute. So that Webstart apps could not get around the issue like this:

      <j2se version="1.6.0_05+"
                java-vm-args="-Dsun.lang.ClassLoader.allowArraySyntax=true" ...

      sun.lang.ClassLoader.allowArraySyntax is not included in this list of secure properties for Java 1.6: http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html#resources .

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      In a JNLP file(.jsp) used for launcing the webstart pass the follwoing:
      <j2se version="1.6.0_05+"
                java-vm-args="-Dsun.lang.ClassLoader.allowArraySyntax=true">
      as part of <resources>.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The webstart JAVA debug console doesnt show the property Dsun.lang.ClassLoader.allowArraySyntax=true from being passed to the VM. This shows that the properoty is filtered out.
      ACTUAL -
      The property is not filterered out when passed into as java-vm-args value.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Caused by: java.lang.ClassNotFoundException: Classloader <x> is not registered. Object of type ....cannot be deserialized from loader
      [Ljava.lang.String;
              at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
              at test.main(test.java:7)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class test {

            public static void main(String[] args) throws Exception {

                String[] s = new String[] { "123" };
                String clName = s.getClass().getName();
                test.class.getClassLoader().loadClass(clName);
            }
        }

      This runs fine on JDK 1.5, but throws this exception on JDK 6.0:

      Exception in thread "main" java.lang.ClassNotFoundException: [Ljava.lang.String;
              at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
              at test.main(test.java:7)

      pasted from Sun bug i.d : 6434149 .

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

      Attachments

        Issue Links

          Activity

            People

              dgu Dennis Gu (Inactive)
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: