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

Regression in JDK1.4 fcs regarding Jar caching.

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description

      I have a client who is having problems while using the cache initialized by the setDefaultUseCaches() method in URLConnection. This problem is specified in bugs#4211817 & 4271671. In bug#4211817, it states that the bug was fixed in Java 1.2.2_10 and verified in 1.3.1_01, but my client is seeing the problem in Java 1.4 fcs. Therefore, this is a regression in Jdk 1.4 fcs.

      We also need a description between the relationship between how the setDefaultUseCaches() method in URLConnection affects the URLClassLoader, and how come the cache is not refreshed when a JAR file contents is modified. This explanation should also be provided in some of the Java Docs for developers to understand more clearly the relationship between these classes.



      My client problem is included below:


      >> >Synopsis: Exception in URLClassLoader
      >> >

      >> -----------------------------
      >> > Bug Id: 4634249
      >> > Product: java
      >> > Category: java
      >> > Subcategory: classes_util
      >> > Release summary: merlin-fcs
      >> > Bug/Rfe/EOU: bug
      >> > State: closed
      >> > Development Status: CLO
      >> > Synopsis: Exception in URLClassLoader
      >> > Keywords: cache, jar, refresh, zip
      >> > Severity: 1
      >> > Severity Impact: Critical
      >> > Severity Functionality: Primary
      >> > Priority: 4
      >> > Responsible Manager: abennett
      >> > Responsible Engineer: kladko
      >> > Description:
      >> >The bug 4353705 is still present in JDK 1.4 build 92. 4353705 stated that
      the
      >> bug was fixed in merlin-rc1, however we have been receiving the same error
      >when
      >> running in Windows NT with JDK 1.4.0-b92. For more info on the bug, please
      >view
      >> bug#4353705.
      >> >
      >> >I have enclosed the error message that I am getting below:
      >> >
      >> >########Start of Error Message###########
      >> >D:\Mings\Silverstream>java -version
      >> >java version "1.4.0"
      >> >Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      >> >Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
      >> >
      >> >D:\Mings\Silverstream>java JarTest
      >> >Loading from classes.jar size = 5
      >> > entry = WEB-INF/
      >> > entry = WEB-INF/classes/
      >> > entry = WEB-INF/classes/com/
      >> > entry = WEB-INF/classes/com/mike/
      >> > entry = WEB-INF/classes/com/mike/SimpleJavaClass.class
      >> >Loading from classes.jar size = 6
      >> > entry = WEB-INF/
      >> > entry = WEB-INF/classes/
      >> > entry = WEB-INF/classes/com/
      >> > entry = WEB-INF/classes/com/mike/
      >> > entry = WEB-INF/classes/com/mike/SimpleJavaClass.class
      >> > entry = WEB-INF/classes/com/mike/SimpleJavaClass2.class
      >> >java.lang.ClassNotFoundException: com.mike.SimpleJavaClass2
      >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      >> > at java.security.AccessController.doPrivileged(Native Method)
      >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
      >> > at JarTest.readJar(JarTest.java:60)
      >> > at JarTest.main(JarTest.java:28)
      >> >
      >> >D:\Mings\Silverstream>
      >> >
      >> >###########End of Error Message############
      >> >
      >> >To reproduce the bug, I have enclosed 3 attached files,
      >> >
      >> >1) JarTest.java
      >> >2) classesA.jar
      >> >3) classesB.jar
      >> >
      >> >What you need to do is place all three files in same directory. Just run
      >> JarTest.java, which will produce the error above, due to URLClassLoader is
      >still
      >> looking for the old JAR file.
      >> >
      >> >
      >> >
      >> >
      >> >Here are the notes that the ISV have emailed us regarding this error:
      >> >
      >> >
      >> >>From: "Alex Rosen" <###@###.###>
      >> >>To: "'Albert Tong-Schmidt'" <###@###.###>
      >> >>Subject: RE: JDK 1.4
      >> >>Date: Thu, 17 Jan 2002 17:23:55 -0500
      >> >>MIME-Version: 1.0
      >> >>X-Priority: 3 (Normal)
      >> >>X-MSMail-Priority: Normal
      >> >>Importance: Normal
      >> >>X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
      >> >>
      >> >>I am still seeing some cache-related problems with JARs in b90. I've
      >> >>attached a test case. The error I get is different, but the fact that
      >> >>setDefaultUseCaches(false) makes it work leads be to think it's at least a
      >> >>related problem.
      >> >>
      >> >>This is not an urgent bug for us, as we are implementing a workaround (by
      >> >>using our own JarFileClassLoader, rather than URLClassLoader). I'm
      >> >>submitting it to you instead of via the web site so that I can attach the
      >> >>sample files.
      >> >>
      >> >>To reproduce, run JarTest in the same directory as classesA.jar and
      >> >>classesB.jar on Windows. (I'm using NT 4.0.) This will copy classesA.jar to
      >> >>classes.jar, read it in, and load all of the .class files from its
      >> >>WEB-INF/classes directory. Then it will copy classesB.jar to classes.jar,
      >> >>and do the same thing. This time, an error occurs - it looks like
      >> >>URLClassLoader is still looking for the old version of the JAR.
      >> >>(classesB.jar contains one more class file than classesA.jar.) If I set
      >> >>setDefaultUseCaches(false) then it works fine.
      >> >>
      >> >>JRE info:
      >> >>
      >> >>java version "1.4.0-rc"
      >> >>Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b90)
      >> >>Java HotSpot(TM) Client VM (build 1.4.0-rc-b90, mixed mode)
      >> >>
      >> >>Output:
      >> >>
      >> >>Loading from classes.jar size = 5
      >> >> entry = WEB-INF/
      >> >> entry = WEB-INF/classes/
      >> >> entry = WEB-INF/classes/com/
      >> >> entry = WEB-INF/classes/com/mike/
      >> >> entry = WEB-INF/classes/com/mike/SimpleJavaClass.class
      >> >>Loading from classes.jar size = 6
      >> >> entry = WEB-INF/
      >> >> entry = WEB-INF/classes/
      >> >> entry = WEB-INF/classes/com/
      >> >> entry = WEB-INF/classes/com/mike/
      >> >> entry = WEB-INF/classes/com/mike/SimpleJavaClass.class
      >> >> entry = WEB-INF/classes/com/mike/SimpleJavaClass2.class
      >> >>java.lang.ClassNotFoundException: com.mike.SimpleJavaClass2
      >> >> at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      >> >> at java.security.AccessController.doPrivileged(Native Method)
      >> >> at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      >> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      >> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
      >> >> at JarTest.readJar(JarTest.java:59)
      >> >> at JarTest.main(JarTest.java:27)
      >> >>

        Attachments

          Activity

            People

            Assignee:
            alanb Alan Bateman
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: