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

Java7 Update 4 loads resources in the wrong order (ignores the classpath)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P3 P3
    • 7u6
    • 7
    • deploy
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.7.0_04"
      Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
      Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP
      Windows 7

      A DESCRIPTION OF THE PROBLEM :
      There are two versions of a resource file packaged in two different jar files.

      The application is executed via Java Web Start.

      The first jar is referenced from the main JNLP file.
      The second jar is referenced from a JNLP component which is referenced from the main JNLP file but AFTER the reference to the first jar.

      This should result in a classpath in which the first jar comes first and the second after it, so when the application calls getResource() with a filename, the resource should be loaded from the first jar file.

      Instead, the resource is now loaded from the second jar which results in misconfigurations and other errors.

      A lot of applications expects the proper load order of resource files so default versions of configuration files are included with libraries so that if the application programmer doesn't include a config file for the library (preceeding the library's jar the classpath) then the processing will fall back to the included default version of the config file.

      This is a huge problem and a big regression since this worked well in Java 6.

      This may affect only WebStart because WebStart may use a special classloader.


      REGRESSION. Last worked in version 6u31

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Package two different versions of a resource file into two different jar files (to the root of the jar). The resource files should have different content but the same filename.

      The application is executed via Java Web Start.

      Create a main JNLP file and a component JNLP file.

      The first jar is referenced from the main JNLP file.

      The second jar is referenced from a component JNLP file.

      The component JNLP file is referenced from the main JNLP file but AFTER the reference to the first jar.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      When the application calls getResource(), it should get the resource file packaged to the first jar.

      ACTUAL -
      When the application calls getResource(), it gets the resource file packaged to the second jar.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      There is no error message but this results in incorrect application behaviour.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Haven't found yet.

      We have to force the users to remove Java 7 from their machines and to install Java 6.

            nam Nam Nguyen (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: