JDK-6209058 : Jar files not cached if web server doesn't return last-modified date
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-12-15
  • Updated: 2010-04-02
  • Resolved: 2004-12-16
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
Java(TM) Plug-in: Version 1.4.2_05
Using JRE version 1.4.2_05 Java HotSpot(TM) Client VM

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Object tag is using the cache_archive and cache_version tags.
SunONE is the default configuration.

A DESCRIPTION OF THE PROBLEM :
The jar file is not cached when the page is served from SunOne 6.1.
The jar file is requested 42 times for a single applet. (this slows down load time extremely.)

Here is the header information:
URL= http://localhost:9000/tcp/tcClient.50028.jar
Header Map
Transfer-encoding=[chunked]
Date=[Thu, 02 Dec 2004 19:37:27 GMT]
Server=[Sun-ONE-Web-Server/6.1]
null=[HTTP/1.1 200 OK]
Content-type=[text/html]
6821035 bytes.


The same jar file IS cached when served by Tomcat, WebLogic, and WebShpere:
Here is the header information:
URL= http://localhost:8000/tcClient.50028.jar
Header Map
Content-Length=[6821035]
ETag=[W/"6821035-1101326154217"]
Date=[Thu, 02 Dec 2004 19:37:25 GMT]
Content-Type=[application/java-archive]
Server=[Apache-Coyote/1.1]
Last-Modified=[Wed, 24 Nov 2004 19:55:54 GMT]
null=[HTTP/1.1 200 OK]
6821035 bytes.


URL= http://localhost:9080/tcp/tcClient.50028.jar
Header Map
Content-Length=[6821035]
Content-Language=[en-US]
Date=[Thu, 02 Dec 2004 19:37:28 GMT]
Server=[WebSphere Application Server/5.1]
Content-Type=[text/plain]
null=[HTTP/1.1 200 OK]
last-modified=[Wed, 01 Dec 2004 21:56:09 GMT]
6821035 bytes.

URL= http://localhost:7001/tcp/tcClient.50028.jar
Header Map
Content-Length=[6821035]
Date=[Thu, 02 Dec 2004 19:37:31 GMT]
Accept-Ranges=[bytes]
Server=[WebLogic Server 8.1 SP3 Tue Jun 29 23:11:19 PDT 2004 404973]
Content-Type=[application/x-java-archive]
Last-Modified=[Wed, 01 Dec 2004 21:56:09 GMT]
null=[HTTP/1.1 200 OK]
6821035 bytes.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Try to cache a jar file when served by a SunONE server.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It should cache the file
ACTUAL -
It never caches the file and

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
The output  in the Description was produced by the following code:
   private static void testTCClientCache() {
       try {
           checkOutTCClient("localhost", 8000, "/", "tcClient.50028.jar");
           checkOutTCClient("localhost", 9000, "/tcp/", "tcClient.50028.jar");
           checkOutTCClient("localhost", 9080, "/tcp/", "tcClient.50028.jar");
//
           checkOutTCClient("localhost", 7001, "/tcp/", "tcClient.50028.jar");
} catch (Exception e) {
e.printStaceTrace();
}


    private static void checkOutTCClient(String host, int port, String base, String jarName) throws MalformedURLException, IOException {
        String urlString = "http://"+host+":"+port+base+jarName;
        System.out.println("URL= "+urlString);
        URL url=new URL(urlString);
         URLConnection conn = url.openConnection();
        Map headerMap = conn.getHeaderFields();
        printMap(headerMap, "Header Map");
        printReturnSize(conn);
    }



Sample Object Tag used:

<OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,1,0" width="100%" height="99%">
<PARAM NAME="CODE" VALUE="com.teamcenter.project.install.DetectPlugin.class">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4"><PARAM NAME="cache_option" VALUE="Plugin">
<PARAM NAME="cache_archive" VALUE="tcClient.50028.jar">
<PARAM NAME="cache_version" VALUE="5.0.0.0">
<PARAM NAME="DVM_REC_VM" VALUE="You are not using a recommended version of java. Please check the release notes for possible issues.">
<PARAM NAME="username" VALUE="admin">
<PARAM NAME="reCache" VALUE="false">
<PARAM NAME="NoCacheUrl" VALUE="/tcp/dashboard.jsp?CACHE=false">
<PARAM NAME="progressbar" VALUE="true">
<PARAM NAME="Version" VALUE="5.0.0 (RC 1)">
<PARAM NAME="tunneling" VALUE="true">
<PARAM NAME="http.authorization" VALUE="accept-encoding: gzip, deflate|::|referer: http://localhost:9000/tcp/appletContent.jsp?myLoc=dashboard.jsp|::|accept-language: en-us|::|cookie: JSESSIONID=5B43E07C3D490ABF87E6EB4278B0E653|::|accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*|::|">
<PARAM NAME="minVM" VALUE="1.4">
<PARAM NAME="sessionID" VALUE="5B43E07C3D490ABF87E6EB4278B0E653">
<PARAM NAME="JarRequest1" VALUE="com.teamcenter.project.teamCenter.TeamCenterVersion50028,LocaleBundle.ser,65129">
<PARAM NAME="SERVER_PORT" VALUE="8899">
<PARAM NAME="JarRequest0" VALUE="com.teamcenter.project.teamCenter.TeamCenterVersion50028,tcClient.50028.jar,5380895">
<PARAM NAME="DVM_MIN_VM" VALUE="This version of java is not supported. Please download the recommended version.">
<PARAM NAME="CLIENT_BASE_URL" VALUE="http://localhost:9000/tcp/">
<PARAM NAME="LOCALE_PARAM" VALUE="en_US">
<PARAM NAME="SERVER_HOST" VALUE="146.122.102.133">
<PARAM NAME="recVM" VALUE="1.4">
<PARAM NAME="VIEW_CLASS" VALUE="com.teamcenter.project.teamCenter.gui.OpenProjectPane">
<PARAM NAME="BASE_URL" VALUE="/tcp/">
<PARAM NAME="ldapSecure" VALUE="false">
<PARAM NAME="AppletClass" VALUE="com.teamcenter.project.teamCenter.TeamCenterAppletClientView">
This page requires the <a href='http://www.javasoft.com'>Sun Java Plugin version 1.4</a></OBJECT>

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

CUSTOMER SUBMITTED WORKAROUND :
The only workaround is to disable jar caching.  Once disabled, it only makes 1 request for the jar file, but obviously it doesn't cache it.
###@###.### 2004-12-15 18:09:25 GMT

Comments
EVALUATION This is a duplicate of #4972238. ###@###.### 2004-12-16 02:24:43 GMT
16-12-2004