JDK-4845728 : Turning on Jar Caching causes a DownloadException and the applet jar fails load
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-04-09
  • Updated: 2010-02-15
  • Resolved: 2006-06-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_13 b01Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Loader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

load: class mycompany.upload.UploadApplet.class not found.

java.lang.ClassNotFoundException: mycompany.UploadApplet.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more

Exception: java.lang.ClassNotFoundException: mycompany.UploadApplet.class



REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
No caching is available.  The application does run, but the jar my be downloaded each time.  Load testing the application is next to impossible.
(Review ID: 183793) 
======================================================================
Name: gm110360			Date: 04/09/2003


FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

FULL OS VERSION :
Windows NT Version 4.0

EXTRA RELEVANT SYSTEM CONFIGURATION :
Applet Jar is located on Websphere 4.03 Server that is behind
2 load-balanced Reverse Proxy servers which provide client certificate authentication and authorization.  All communication is under secure sockets.

A DESCRIPTION OF THE PROBLEM :
I am using the latest plugin to address problems noted in
  Bug#4681427.  I have successfully converted my certificate from
a PKCS12 format to JKS and am able to run the applet thru my
firewalls as described in the fix so long as I do not enable Jar
caching in the Plugin Control Panel.  Once I enable Jar caching
I get a DownloadException and the Applet does not load.



EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected Jar file to download and be cached in the directory specified by the plugin control panel and for the jar to load.
Saw download exception noted above.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
(NOTE:To protect our security all information relevant to specific names has been altered)

Java(TM) Plug-in: Version 1.4.2
Using JRE version 1.4.2-beta Java HotSpot(TM) Client VM
User home directory = C:\WINNT\Profiles\user

Loading user-defined proxy configuration ...
    Auto config URL:
    Proxy list:
    Proxy override:
Done.
Loading manual proxy configuration ...
Done.
Proxy Configuration: Manual Configuration
     Proxy:
     Proxy Overrides:
Cache is enabled
Location: C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\cache\javapi\v1.0

Maximum size: 50 MB
Compression level: 0
Dump system properties ...
----------------------------------------------------
acl.read = +
acl.read.default =
acl.write = +
acl.write.default =
application.home = C:\PROGRA~1\Java\J2RE14~1.2
awt.toolkit = sun.awt.windows.WToolkit
browser = sun.plugin
browser.vendor = Sun Microsystems, Inc.
browser.version = 1.1
deployment.javaws.cache.dir = C:\WINNT\Profiles\user\.javaws\cache
deployment.javaws.jre.2.enabled = true
deployment.javaws.jre.2.location = http://java.sun.com/products/autodl/j2se
deployment.javaws.jre.2.osarch = x86
deployment.javaws.jre.2.osname = Windows
deployment.javaws.jre.2.path = C:\Program Files\Java\j2re1.4.1_02\bin\javaw.exe
deployment.javaws.jre.2.platform = 1.4
deployment.javaws.jre.2.product = 1.4.1_02
deployment.javaws.jre.2.registered = true
deployment.javaws.jre.3.enabled = true
deployment.javaws.jre.3.location = http://java.sun.com/products/autodl/j2se
deployment.javaws.jre.3.osarch = x86
deployment.javaws.jre.3.osname = Windows
deployment.javaws.jre.3.path = C:\Program Files\Java\j2re1.4.2\bin\javaw.exe
deployment.javaws.jre.3.platform = 1.4
deployment.javaws.jre.3.product = 1.4.2-beta
deployment.javaws.jre.3.registered = true
deployment.javaws.logFileName = c:\sessionlog.webstart
deployment.javaws.logToFile = true
deployment.javaws.player.bounds = 698,87,411,384
deployment.javaws.player.manager = 1
deployment.javaws.player.mode = 1
deployment.javaws.proxy.http = myproxyserver.org
deployment.javaws.proxy.httpport = 8080
deployment.javaws.proxy.httpproxyoverride =
deployment.javaws.proxy.setting = MANUAL
deployment.javaws.showConsole = true
deployment.javaws.splash.cache = C:\WINNT\Profiles\user\.javaws\cache\splashes\splash.xml
deployment.javaws.version = javaws-1.4.2-beta
deployment.javaws.whatInstall = 3
deployment.javaws.whenInstall = 3
deployment.system.cacerts = C:\PROGRA~1\Java\J2RE14~1.2\lib\security\cacerts
deployment.system.home = C:\WINNT\Sun\Java\Deployment
deployment.system.jssecacerts = C:\PROGRA~1\Java\J2RE14~1.2\lib\security\cacerts
deployment.system.profile = C:\WINNT
deployment.system.security.policy = file:/C:/WINNT/Sun/Java/Deployment/security/java.policy
deployment.user.cachedir = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\cache
deployment.user.certs = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\security\deployment.certs
deployment.user.extdir = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\ext
deployment.user.home = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment
deployment.user.jssecerts = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\security\deployment.jssecerts
deployment.user.logdir = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\log
deployment.user.profile = C:\WINNT\Profiles\user\Application Data
deployment.user.security.policy = file:/C:/WINNT/Profiles/user/Application%20Data/Sun/Java/Deployment/security/java.policy
deployment.user.tmpdir = C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\cache\tmp
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = file.separator.applet = true
http.agent = Mozilla/4.0 (Windows NT 4.0)
http.auth.serializeRequests = true
https.protocols = SSLv3,SSLv2Hello
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\PROGRA~1\Java\J2RE14~1.2\classes
java.class.version = 48.0
java.class.version.applet = true
java.endorsed.dirs = C:\PROGRA~1\Java\J2RE14~1.2\lib\endorsed
java.ext.dirs = C:\PROGRA~1\Java\J2RE14~1.2\lib\ext
java.home = C:\PROGRA~1\Java\J2RE14~1.2
java.io.tmpdir = C:\TEMPjava.library.path = C:\PROGRA~1\INTERN~1;.;C:\WINNT\System32;C:\WINNT;C:\PROGRA~1\INTERN~1\;;c:\program files\cmsynergy\ccm62\fedach\lib\notify\Windows;c:\program files\ibm\application developer;C:\Perl\bin\;c:\ruby\bin;C:\WINNT\system32;C:\WINNT;C:\MSSQL7\BINN;C:\SNA\system;C:\WINNT\System32\WBEM;C:\Lotus\Notes;c:\program files\cmsynergy\ccm62\bin;C:\Program Files\Hummingbird\Connectivity\7.11\Accessories;c:\program file\java\j2re1.4.1_02\bin\;C:\Program Files\IBM\WebSphere MQ\bin;C:\Program Files\IBM\WebSphere MQ\tools\c\samples\bin;C:\PROGRA~1\IBM\IMNNQ;C:\Program Files\SQLLIB\BIN;C:\Program Files\SQLLIB\FUNCTION;C:\Program Files\SQLLIB\SAMPLES\REPL;C:\Program Files\SQLLIB\HELP;c:\program files\java\j2re1.4.1_02\bin;;C:\PROGRA~1\E!OC
java.net.debug = ssl,handshake,trustmanager
java.protocol.handler.pkgs = sun.plugin.net.protocol|sun.plugin.net.protocol
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version = 1.4.2-beta-b19
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.4
java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFactory
java.vendor = Sun Microsystems Inc.
java.vendor.applet = true
java.vendor.url = http://java.sun.com/
java.vendor.url.applet = true
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.4.2-beta
java.version.applet = true
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 1.4.2-beta-b19
javaplugin.console = show
javaplugin.exception = false
javaplugin.jre.params = -Djava.net.debug=ssl,handshake,trustmanager -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|liveconnect -Djavax.net.ssl.keyStore=c:\pkcsKeyStore -Djavax.net.ssl.keyStorePassword=password
javaplugin.jre.path = C:\Program Files\Java\j2re1.4.2
javaplugin.jre.type = JRE
javaplugin.jre.version = 1.4.2
javaplugin.maxHeapSize = 96m
javaplugin.nodotversion = 142
javaplugin.proxy.config.list =
javaplugin.proxy.config.type = manual
javaplugin.proxy.usebrowsersettings = false
javaplugin.trace = true
javaplugin.trace.option = basic|net|security|liveconnect
javaplugin.version = 1.4.2
javaplugin.vm.options = -Djava.class.path=C:\PROGRA~1\Java\J2RE14~1.2\classes -Xbootclasspath/a:C:\PROGRA~1\Java\J2RE14~1.2\lib\plugin.jar -Xmx96m -Djavaplugin.maxHeapSize=96m -Xverify:remote -Djavaplugin.version=1.4.2 -Djavaplugin.nodotversion=142 -Dbrowser=sun.plugin -DtrustProxy=true -Dapplication.home=C:\PROGRA~1\Java\J2RE14~1.2 -Djava.net.debug=ssl,handshake,trustmanager -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|liveconnect -Djavax.net.ssl.keyStore=c:\pkcsKeyStore -Djavax.net.ssl.keyStorePassword=password -Djava.protocol.handler.pkgs=sun.plugin.net.protocol
javax.net.ssl.keyStore = c:\pkcsKeyStore
javax.net.ssl.keyStorePassword = password
line.separator = \r\n
line.separator.applet = true
os.arch = x86
os.arch.applet = true
os.name = Windows NT
os.name.applet = true
os.version = 4.0
os.version.applet = true
package.restrict.access.netscape = false
package.restrict.access.sun = true
package.restrict.definition.java = true
package.restrict.definition.netscape = true
package.restrict.definition.sun = true
path.separator = ;
path.separator.applet = true
sun.arch.data.model = 32
sun.boot.class.path = C:\PROGRA~1\Java\J2RE14~1.2\lib\rt.jar;C:\PROGRA~1\Java\J2RE14~1.2\lib\i18n.jar;C:\PROGRA~1\Java\J2RE14~1.2\lib\sunrsasign.jar;C:\PROGRA~1\Java\J2RE14~1.2\lib\jsse.jar;C:\PROGRA~1\Java\J2RE14~1.2\lib\jce.jar;C:\PROGRA~1\Java\J2RE14~1.2\lib\charsets.jar;C:\PROGRA~1\Java\J2RE14~1.2\classes;C:\PROGRA~1\Java\J2RE14~1.2\lib\plugin.jar
sun.boot.library.path = C:\PROGRA~1\Java\J2RE14~1.2\bin
sun.cpu.endian = little
sun.cpu.isalist =
sun.io.unicode.encoding = UnicodeLittle
sun.java2d.fontpath =
sun.net.client.defaultConnectTimeout = 120000
sun.os.patch.level = Service Pack 6
trustProxy = true
user.country = US
user.dir = C:\WINNT\Profiles\user\Desktop
user.home = C:\WINNT\Profiles\user
user.language = en
user.name = user
user.timezone =
user.variant =
----------------------------------------------------
Done.



----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
Registered modality listener
Invoking JS method: document
Invoking JS method: URL
Referencing classloader: sun.plugin.ClassLoaderInfo@6355dc, refcount=1
Loading applet ...
Initializing applet ...
Starting applet ...
Connecting https://myfirewall.org/junction/context_root/directory/TheJar.jar with no proxy

Connecting https://myfirewall.org/junction/context_root/directory/TheJar.jar with cookie "FirewallStateCookie=/junction; AMWEBJCT!/junction!JSESSIONID=0000XOJFTQFI1LN4KLZU11WD4TY:u8u4tt6p; FirewallSessionCookie-ID=2_rC9OmSqzMnlXgIuDMTqLbv5FDAvETx478YhRpLFN8DoAAAAJ; IV_JCT=/junction"

Loading Root CA certificates from C:\PROGRA~1\Java\J2RE14~1.2\lib\security\cacerts

Loaded Root CA certificates from C:\PROGRA~1\Java\J2RE14~1.2\lib\security\cacerts

Loading Https Root CA certificates from C:\PROGRA~1\Java\J2RE14~1.2\lib\security\cacerts

Loaded Https Root CA certificates from C:\PROGRA~1\Java\J2RE14~1.2\lib\security\cacerts

Loading JPI Https certificates from C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\security\deployment.jssecerts

Loaded JPI Https certificates from C:\WINNT\Profiles\user\Application Data\Sun\Java\Deployment\security\deployment.jssecerts
Loading certificates from JPI session certificate store
Loaded certificates from JPI session certificate store
Checking if certificate is in JPI session certificate store
Checking if Https certificate is in JPI permanent certificate store
Server https://myfirewall.org/junction/context_root/directory/TheJar.jar requesting to set-cookie with "FirewallSessionCookie; Path=/; Secure"

Server https://myfirewall.org/junction/context_root/directory/TheJar.jar requesting to set-cookie with "FirewallSessionCookie=/junction; Path=/junction"

Downloading https://myfirewall.org/junction/context_root/directory/TheJar.jar to cache

Connecting https://myfirewall.org/junction/context_root/directory/org/company/directory/upload/UploadApplet.class with no proxy

Connecting https://myfirewall.org/junction/context_root/directory/org/company/directory/upload/UploadApplet.class with cookie "FirewallStateCookie=/junction; PD_STATEFUL_9b951e8a-3ab3-11d7-b5ef-ac1e1123aa77=/fedach_web_dev; AMWEBJCT!/FirewallSessionCookie; FirewallSessionCookie; JCT=/junction"

sun.plugin.cache.DownloadException
	at sun.plugin.cache.CachedFileLoader.load(Unknown Source)
	at sun.plugin.cache.FileCache.get(Unknown Source)
	at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connectWithCache(Unknown Source)

	at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connect(Unknown Source)

	at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.getInputStream(Unknown Source)

	at java.net.HttpURLConnection.getResponseCode(Unknown Source)

	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)

	at sun.applet.AppletClassLoader.getBytes(Unknown Source)

	at sun.applet.AppletClassLoader.access$100(Unknown Source)

	at sun.applet.AppletClassLoader$1.run(Unknown Source)

	at java.security.AccessController.doPrivileged(Native Method)

	at sun.applet.AppletClassLoader.findClass(Unknown Source)

	at java.lang.ClassLoader.loadClass(Unknown Source)

	at sun.applet.AppletClassLoader.loadClass(Unknown Source)

	at java.lang.ClassLoader.loadClass(Unknown Source)

	at sun.applet.AppletClassLoader.loadCode(Unknown Source)

	at sun.applet.AppletPanel.createApplet(Unknown Source)

	at sun.plugin.AppletViewer.createApplet(Unknown Source)

	at sun.applet.AppletPanel.runLoader(Unknown Source)

	at sun.applet.AppletPanel.run(Unknown Source)

	at java.lang.Thread.run(Unknown Source)

Connecting https://myfirewall.org/junction/context_root/directory/org/company/directory/upload/UploadApplet.class  with no proxy

Connecting https://myfirewall.org/junction/context_root/directory/org/company/directory/upload/UploadApplet.class  "FirewallSessionCookie=/junction; FirewallSessionCookie=/junction; AMWEBJCT!/junction!JSESSIONID=0000XOJFTQFI1LN4KLZU11WD4TY:u8u4tt6p; FirewallSessionCookie; IV_JCT=/junction"

sun.plugin.cache.DownloadException
	at sun.plugin.cache.CachedFileLoader.load(Unknown Source)
	at sun.plugin.cache.FileCache.get(Unknown Source)
	at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connectWithCache(Unknown Source)
	at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.getInputStream(Unknown Source)
	at java.net.HttpURLConnection.getResponseCode(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClass
tharris 3-6-2006 I have added the test cases Juniper Networks provided to demonstrate the bug being experienced at British Telecom. Juniper provides the test cases  (cacheing_zip and ATT5359632.txt) with the following explainations:

The problem we have is that if the JAR file name contains an asterisk  
character (*) and applet caching is enabled in the Java plugin, the  
applet fails to start. This happens with Java Plug-In 1.5.0_06.

I've attached a zip file containing the following:

1. A sample applet whose name contains an asterisk.
2. Some sample HTML used to embed this applet, and some images used  
by the applet.
3. The Java Plugin console output when caching is enabled and this  
applet is accessed.
4. The Java Plugin console output when caching is disabled and this  
applet is accessed.
5. A tcpdump file showing the traffic when this applet is accessed  
and caching is enabled.

To reproduce, simply place this content anywhere on a web server and  
use Java Plugin 1.5.0_06 to access the applet. Make sure that caching  
is enabled in the Plugin. Again, SSL is not required, although the  
problem happens both with and without SSL.

Comments
EVALUATION The fix will involve looking at bug #4776980 and bug #4979820 to align the codebase with Tiger
26-09-2005

EVALUATION ###@###.### 2003-04-18 This problem is reported by customer is happened when Jar Caching is tured on and accessing SSL with client authentication. I did test it here using our SSL server with client authentication and Jar caching enabled, can't reproduce the bug. I have contacted with customer who submit this bug, they are using reverse proxy firewall and has complex security layer due to the natural their business (Federal Reserve Bank), at this point they can't give me any real information about their security setting and testcase due to their security procedure. They are working on this and hope will provide me more useful info about this bug. Dennis This bug is reproduced on JRE 1.4.2_06 release, the simple testcase is attached in this bug report. But this bug can't be reproduced on Tiger 1.5 release. You can run it from my webserver too: https://eltanin:4433/dennis/bug/4845728/dist/ But you have to import one personal certificate and one ca into your browser and JRE keystore first. The certificate is attached to this bug too: poonam.p12 (password:1234) ca.crt Because there are 64 votes on this bug, and this bug will cause some performance hit also, I recommand to fix it on 1.4.2 updated release, therefore I reassign it to CTE group. I alos filed a fix request #2157. ###@###.### 2004-12-16 17:42:16 GMT Why the bug is marked as incomplete : This bug is reported by customer on their internal application, which run on a reverse proxy server. We don't have that config in Sun and a simple testcase was required, which we never got , that is why the bug is marked incomplete by the PDE Evaluation: This is an issue in AppletClassLoader.java wherein when the class is being loaded from the code base URL it appends it with a .class Thus the properties files are all appended with a .class and when they are not found in the .jar file , 404 is passed on further above finally leading to a Download Exception ###@###.###
02-10-2004