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

REGRESSION: ClassLoader hierarchy change

XMLWordPrintable

    • x86
    • windows_7

      J2SE Version (please include all output from java -version flag):
        java version "1.7.0_25"
        Java(TM) SE Runtime Environment (build 1.7.0_25-b11)
        Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode, sharing)

      Does this problem occur on J2SE 6ux or 7ux? Yes / No (pick one)
         Unique to update 1.7.0_25 b11

      Operating System Configuration Information (be specific):
         Windows 7 Ultimate 64 bit SP-1

      Regression:
          Not seen with 7u25 b09

      Bug Description:

      There has been a change to the deployment class loader hierarchy that will cause some trouble. Have a file next to jar files that need to access. And find this file by doing something like the code below. Previously, this would return all jar files. Now, it seems to only return deploy.jar.

      Did it the way so not need to use the javax.jnlp.* classes (making the code universally accessible).
      Have implemented a workaround for this using reflection to access the javax.jnlp.* services and can get the codebase from the javax.jnlp.BasicServer.getCodeBase(). It is uglier code, but can be managed without the javax.jnlp.* libraries accessible and it works with build 11. However need broadcast a warning to our clients not to upgrade until we can roll out that change. 3-4 weeks is not a lot of time to do this.

      If this change is definitely going to be rolled out, need to know soon, so can figure out how we are going to deal with it.


      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      if (loader instanceof URLClassLoader) {
                      URL[] urls = urlLoader.getURLs();
                      .....
      }

            ngthomas Thomas Ng (Inactive)
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: